I am trying to execute a very simple script.
It only prints the first argument passed.
The code is
import sys
def check(argument):
'''Open, read, and print a file.'''
print argument
if __name__ == "__main__":
check(sys.argv[1])
however when i execute from command line, i always get this error
C:\>sample.py myname
Traceback (most recent call last):
File "C:\sample.py", line 7, in <module>
check(sys.argv[1])
IndexError: list index out of range
Any help
This might be a Windows issue: http://bugs.python.org/issue7936