I was looking for ways to add argument values to a script when I run it from the command line. Two packages found that seem to do this are sys.argv and argparse.
I would also like to add some help function if possible.
Can someone explain the difference between the two, and maybe it will be easier for someone to start?
sys.argv is just a list of command line arguments.
sys.argv
argparse- A full-featured command line parser that typically parses sys.argvand returns data much easier to use.
argparse
- , script, , . python python 3 (getopt, optparse argparse) argparse.
getopt
optparse
argparse . arg , , -, , argparse .
: https://docs.python.org/2/howto/argparse.html
, .
Source: https://habr.com/ru/post/1628522/More articles:Gmail REST support api for receiving messages - gmailSetting current time to default and updating value - javascriptCan I set Spring to the local location of the boot log programmatically? - javaThree.js adds an object to the group, but retains the global position / rotation / scale, as it were - javascriptChanging the world position of a child in a Three.js file - javascriptустановленное соединение было прервано программным обеспечением вашей хост-машины бродягой - vagrantCheck out some views and 404 others in express.js - node.jsTouch not recognized - swiftThe Linq Greater and Less Than operator on a date string - c #Adding a new locale in Android OS - androidAll Articles