在我的程序中,我有一个函数runScript():
def runScript():
subprocess.call(['echo', 'hello'])
Run Code Online (Sandbox Code Playgroud)
我在Python文档中看到过很多类似的例子,所以我认为这样可行.但是,当我在程序中调用此函数时,它返回一个WindowsError.
WindowsError: [Error 2] The system cannot find the file specified
Run Code Online (Sandbox Code Playgroud)
为什么会这样?我该如何解决?