I\'m using the ideone online interpreter (http://ideone.com/) to test some C++ and Python programs. How do I specify the command line arguments instead of using the STDIN input?
In python you can hardcode like this:
import sys print sys.argv sys.argv[1:] = ["test1", "test2"] print sys.argv
This will output:
['prog.py'] ['prog.py', 'test1', 'test2']
To read from stdin:
import sys import shlex print sys.argv sys.argv[1:] = shlex.split(None) print sys.argv