简体   繁体   English

如何在Windows 64位元中使用python呼叫32位元exe?

[英]How would I call 32bit exes in Windows 64bit with python?

I want to call a exe from python on a 64bit version of vista. 我想在64位版本的Vista上从python调用exe。 I know to use subprocess, but all the 32bit apps are store in C:\\Program Files (x86)\\, and it doesn't like the spaces I believe. 我知道要使用子进程,但是所有32位应用程序都存储在C:\\ Program Files(x86)\\中,并且它不喜欢我相信的空间。 i have tried escape characters, doesn't fire, any ideas? 我尝试过转义字符,不射击,有什么想法吗?

textEditorExecutablePath = 'C:\\Program Files (x86)\\Notepad2\\Notepad2.exe'
filepathToOpen = 'C:\\file.txt'
subprocess.Popen([textEditorExecutablePath, filepathToOpen])

Works for me. 为我工作。 How are you calling Popen? 你怎么打电话给Popen?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM