python: can't open file 'test.py': [Errno 2] No such file or directory
在当前目录下,运行位于另外一个目录的py文件。
C:\>python Test001.py
python: can't open file 'Test001.py': [Errno 2] No such file or directory
如果指定了文件的全路径,运行正常
C:\>python c:\testdir\Test001.py
this is a test
我试图将c:\testdir加入到系统环境变量PATH里,但是仍然报错,can't open file 'Test001.py': [Errno 2] No such file or directory
是不是如果运行的py脚本不在当前目录下,就必须要指定全路径?