I am a beginner at Python and am wondering what is the absolute fastest way to get command line arguments into the script. I am trying to build it for speed.
commandline$ python3.7 script.py arg1 arg2 arg3
All I need is those args assigned to a variable so I can use them later on in the script. I don’t need any help guide or anything else as the script is for my own use.
The raw string tokens are available via sys.argv, but many find using either argparse or even something like click easier to use as things get complex.
If the arguments are mainly for specifying files to be opened (rather than options for your script), looking at fileinput might be useful.