我试图制作一个代码,每次用户输入单词" Hello", 代码将打印Hello.py的输出,该输出位于与我的代码相同的路径中,但它不起作用 问题在于elif(输入==" Hello")
我得到的错误:
追踪(最近一次呼叫最后一次):
https://localhost:44301/
File "C:\Users\Nir Nir\Desktop\shell\check.py", line 34, in <module>
j = subprocess.check_output('python ' + PATH_OF_SCRIPTS + '\\' + input.split(' ')[0] + '.py', shell = True)
File "C:\Python27\lib\subprocess.py", line 537, in check_output
raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command 'python C:\Users\Nir Nir\Desktop\shell\Hello.py' returned non-zero exit status 2