I run a python script with "python main.py" in the shell under the main.py directory, it reports an errors and stops.But when I run the same script with full path like "python /home/work/main.py" under the same circumstance, It is blocked until I interrupt it with "Ctrl+C", a error is reported when it is interrupted.But it seems go the same and normally if no errors exist.
I don't know why, can somebody tell me ?
the errors:
^CTraceback (most recent call last):
File "/home/work/video/fe/tvservice/main.py", line 17, in <module>
from conf.settings import DATABASE_TV, WEB_SERVER_CONFIG, DATABASE_TV_MASTER,DATABASE_TV_LOG_MASTER, ZOOKEEPER_CONFIG
File "/home/work/video/fe/tvservice/conf/settings.py", line 1
hello world
^
settings.py hello world
python main.py, make sure you are in the correct directory by usingcd /home/workbefore you execute the main.py file.SyntaxError, but the traceback should include information about type of the error.sys.argv[0]being different. Executing it through a different path has no effect on how the script runs.