-2
運行python我有一個shell腳本,在MAC以下:殼牌無法在Mac
python Test.py
和Test.py低於:
import subprocess
import os.path
from os import listdir
from os.path import isfile, isdir, join
from filecmp import dircmp
import json
import sys
import shutil
....(skip)
,我執行 「蟒蛇Test.py」在Mac終端中,沒關係。 但我執行「./Test.sh」 它會得到如下錯誤:
./Test.py: line 1: import: command not found
./Test.py: line 2: import: command not found
from: can't read /var/mail/os
from: can't read /var/mail/os.path
from: can't read /var/mail/filecmp
./Test.py: line 6: import: command not found
./Test.py: line 7: import: command not found
./Test.py: line 8: import: command not found
你爲什麼編輯你的問題來說'/ Test.sh'?從你的輸出中可以看出,這不是你實際運行的內容。 – 2014-09-05 10:12:02