On Aug 24, 2017 10:33 PM, "Cheng-Hung Hsueh" wrote:
It is a python script `tshi3.py` :
在此輸入代碼...
import csv
def li2ho2():
print(csv)
li2ho2()
I copied this code and pasted it in `python manage.py shell`. It works.
But I ran `python manage.py shell < tshi3.py`. Got `NameE
Wild guess: Different default directory.
Try setting PYTHONPATH, or add "os.chdir('some/dir')" to top of script...
On 08/24/2017 10:33 PM, Cheng-Hung Hsueh wrote:
It is a python script `|tshi3.py|` :
|
在此輸入代碼...
|importcsv defli2ho2():print(csv)li2ho2()|
|
I copied this code and past
It is a python script `tshi3.py` :
在此輸入代碼...
import csv
def li2ho2():
print(csv)
li2ho2()
I copied this code and pasted it in `python manage.py shell`. It works.
But I ran `python manage.py shell < tshi3.py`. Got `NameError: name 'csv'
is not defined.`
Why?
Enviromen
3 matches
Mail list logo