I'm using Python 2.7, and I have the following simple script, which expects one command line argument:
#!/usr/bin/env python
import sys
if (len(sys.argv) == 2):
print "Thanks for passing ", sys.argv[1]
else:
print "Oops."
I can do something like this from the command line:
My-Box:~/$ ./useArg.py asdfkjlasdjfdsa
Thanks for passing asdfkjlasdjfdsa
or this:
My-Box:~/$ ./useArg.py
Oops.
I would like to do something similar from the interactive editor:
>>> import useArg asdfasdf
File "<stdin>", line 1
import useArg asdfasdf
^
SyntaxError: invalid syntax
but I don't know how. How can I pass a parameters to import/reload in the interactive editor ?