Hi I am new to Python and have currently copied following script:
# filename is printer.py
import sys
for arg in sys.argv:
print arg # the zeroth element is the module name
raw_input("press any key") # a trick to keep the python console open
I am trying to get the arguments followed by the module name. But running this code gives me following error:
U:\printer.py
File "U:\printer.py", line 6
print arg # zeroth element is the module name
^
SyntaxError: Invalid syntax
Does anyone know what could be wrong here? I am using Python 3.2