繁体   English   中英

Python:调用可执行文件失败

[英]Python: Calling executable fails

我正在尝试在Python中运行其中任何一个...

subprocess.call(r"C:\Windows\System32\fsquirt.exe", shell=True)
subprocess.call("C:\\Windows\\System32\\fsquirt.exe", shell=True)
subprocess.call(r"C:/Windows/System32/fsquirt.exe", shell=True)
subprocess.call("C:/Windows/System32/fsquirt.exe", shell=True)

他们都导致...

'C:/Windows/System32/fsquirt.exe' is not recognized as an internal or external command,
operable program or batch file.

如果我只是将fsquirt.exe复制到本地目录中,则可以从该目录中调用它,因此,我确定我对目录的使用方式必须做得有些愚蠢。

我应该怎么做?

问题是我正在使用不使用System32的64位Windows(从32位Python运行)。 64位Windows通常使用SysWOW64而不是System32。 调用虚拟目录Sysnative而不是这两个目录中的任何一个,将根据您所运行的内容(对我而言,是32位Python)来确定需要调用哪个虚拟目录。 Fsquirt仅存在于System32中,而不存在于SysWOW64中。 这与两者中都存在的类似记事本的东西不同。

subprocess.call("C:/Windows/Sysnative/fsquirt.exe")

暂无
暂无

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

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