Re: Cannot access imported functions in django shell by pipeline command

2017-08-25 Thread James Schneider
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

Re: Cannot access imported functions in django shell by pipeline command

2017-08-25 Thread Mike Morris
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

Cannot access imported functions in django shell by pipeline command

2017-08-24 Thread Cheng-Hung Hsueh
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