How can I read and process (parse) command line arguments?

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. sys.argv[0] is the script name.

Basically,

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

Leave a Comment