T
theemails
New to Python ... this should be an easy question to answer.
INPUT
import sys
print 'The command line arguments are:'
for i in sys.argv:
print i
print '\nThe PYTHONPATH is', sys.path
OUTPUT
The command line arguments are:
C:\Python25\using_sys.py
The PYTHONPATH is ['C:\\Python25\\Lib\\idlelib',
'C:\\Python25\\python25.zip', 'C:\\Python25\\DLLs',
'C:\\Python25\\lib', 'C:\\Python25\\lib\\plat-win',
'C:\\Python25\\lib\\lib-tk', 'C:\\Python25',
'C:\\Python25\\lib\\site-packages']
It works fine when I 'Run Module'...but when I type in interactive mode
in the Python Shell
I get the following error:
SyntaxError: invalid syntax
How can I fix this?
INPUT
import sys
print 'The command line arguments are:'
for i in sys.argv:
print i
print '\nThe PYTHONPATH is', sys.path
OUTPUT
The command line arguments are:
C:\Python25\using_sys.py
The PYTHONPATH is ['C:\\Python25\\Lib\\idlelib',
'C:\\Python25\\python25.zip', 'C:\\Python25\\DLLs',
'C:\\Python25\\lib', 'C:\\Python25\\lib\\plat-win',
'C:\\Python25\\lib\\lib-tk', 'C:\\Python25',
'C:\\Python25\\lib\\site-packages']
It works fine when I 'Run Module'...but when I type in interactive mode
in the Python Shell
I get the following error:
SyntaxError: invalid syntax
How can I fix this?