且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Python 的文件夹中运行 Tcl 脚本?

更新时间:1970-01-01 07:57:12

尝试使用 subprocess.call

subprocess.call 将避免必须处理各种 shell 的引用约定的问题.它接受一个列表,而不是一个字符串,所以参数更容易分隔.即

subprocess.call will avoid problems with having to deal with quoting conventions of various shells. It accepts a list, rather than a string, so arguments are more easily delimited. i.e.

import subprocess
subprocess.call(['C:\\Temp\\a b c\\Notepad.exe', 'C:\\test.txt'])