Skip to content

Instantly share code, notes, and snippets.

@tanyuan
Created January 7, 2018 18:36
Show Gist options
  • Select an option

  • Save tanyuan/6895588c2973bc9703cf2e4f82b99ee5 to your computer and use it in GitHub Desktop.

Select an option

Save tanyuan/6895588c2973bc9703cf2e4f82b99ee5 to your computer and use it in GitHub Desktop.

Revisions

  1. tanyuan created this gist Jan 7, 2018.
    8 changes: 8 additions & 0 deletions python_args.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    import argparse

    if __name__ == '__main__' :

    parser = argparse.ArgumentParser(description='Program description')
    parser.add_argument('input', help='Input file')
    parser.add_argument('-o', '--option', type=int, help='Integer option')
    args = parser.parse_args()