我有一个Python脚本需要在同一目录中调用另一个Python脚本.我这样做了:
from subprocess import call
call('somescript.py')
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
call('somescript.py')
File "/usr/lib/python2.6/subprocess.py", line 480, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.6/subprocess.py", line 633, in __init__
errread, errwrite)
File "/usr/lib/python2.6/subprocess.py", line 1139, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Run Code Online (Sandbox Code Playgroud)
我虽然在同一个文件夹中有脚本somescript.py.我在这里错过了什么吗?
标题几乎都说明了.我想知道python中使用了哪个python可执行文件.就像是
Python 2.7.2 (default, Nov 1 2011, 03:31:17) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> print <insert the code I'm after here> /usr/local/bin/python2.7 >>>
Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> print <insert the code I'm after here> /usr/bin/python2.6 >>>
你得到了照片
谢谢