How to read/process command line arguments?

edgerA picture edgerA · Jun 18, 2009 · Viewed 654.4k times · Source

Answer

John Slavick picture John Slavick · Jun 18, 2009
import sys

print("\n".join(sys.argv))

sys.argv is a list that contains all the arguments passed to the script on the command line.

Basically,

import sys
print(sys.argv[1:])