Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

https://www.youtube.com/playlist?list=PLhOuww6rJJNNx06soCkb4aMFhuioQ7tY5

Examples of programs using argparse

This is a collection of example programs to show how you can use the standard Python module argparse to handle command-line aruguments.

  • sys_argv.py: sys.argv
  • one_arg.py: one positional argument
  • two_args.py: two positional arguments
  • nargs2.py: another way to handle two positional arguments
  • nargs+.py: one or more positional arguments
  • manual.py: manually validating an argument inside get_args
  • choices.py: using choices to restrict values
  • cat_n.py: a Python implementation of cat -n
Morty Proxy This is a proxified and sanitized view of the page, visit original site.