I am trying to pass "sys.argv[1]" into a function.
#!/usr/bin/env/ python
import sys
def main():
test(sys.argv[1])
def test(sys.argv[1]):
print "Hello " + sys.argv[1]
./arg.py World
File "./arg.py", line 5
def test(sys.argv[1]):
^
SyntaxError: invalid syntax
Not sure where to go from here after scowering the Interwebs for a few hours. I have also tried to set the "sys.argv[1]" to a variable and tried passing that into the function and still no avail.