我有一個100行,3歲的蟒蛇刮刀,現在的錯誤。啓動線路有:Python:OSError:[Errno 2]沒有這樣的文件或目錄:''
import urllib, re, os, sys, time # line 1: import modules
os.chdir(os.path.dirname(sys.argv[0])) # line 2: all works in script's folder > relative address
# (rest of my script here!)
運行時,
$cd /my/folder/
$python script.py
我收到的錯誤:
python script.py
Traceback (most recent call last):
File "script.py", line 2, in <module>
os.chdir(os.path.dirname(sys.argv[0]))
OSError: [Errno 2] No such file or directory: ''
我應該怎樣讀這個錯誤,做些什麼?
我確實得到了錯誤。 – MontyPython