我正在尝试调用名称中有括号的可执行文件(例如'test(1).exe')。在Python 3.6.2中,当我尝试以下操作时:我得到了:
'test' is not recognized as an internal or external但是,如果我通过删除'('将文件名更改为'test1).exe',则以下操作将成功:
几天前,我的程序中有一行os.system(r"C:\Users\red\Desktop\Test UI")。我测试了它,它工作得很好,它就像我想要的那样打开了应用程序。os.system fails due to spaces in path这样的关于os.system的其他问题,但我已经使用了一个原始的字符串,就像其中一个答案建议的那样。