Reputation: 3559
I want do start the python interpreter and debug with sys.argv. I do not want to provide a python file. If I provide a file, the interpreter executes the file and finishes.
Is there a way to archive this?
python argA argB
...
>>> import sys
>>> print sys.argv
['argA','argB']
Upvotes: 6
Views: 1313
Reputation: 2764
This is pretty much what you want:
$ python - argA argB
The first argument will show up as -
, though - think of it as a pseudo script name. I don't think you can get away from that.
Upvotes: 9