我想在64位版本的vista上调用python的exe。我知道使用子进程,但所有32位应用程序都存储在C:\ Program Files(x86)\中,并且它不喜欢我认为的空格。我试过逃脱角色,不开火,有什么想法吗?
答案 0 :(得分:1)
textEditorExecutablePath = 'C:\\Program Files (x86)\\Notepad2\\Notepad2.exe'
filepathToOpen = 'C:\\file.txt'
subprocess.Popen([textEditorExecutablePath, filepathToOpen])
适合我。你怎么称Popen?