Skip to content

Instantly share code, notes, and snippets.

@tanyuan
Created January 7, 2018 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanyuan/6895588c2973bc9703cf2e4f82b99ee5 to your computer and use it in GitHub Desktop.
Save tanyuan/6895588c2973bc9703cf2e4f82b99ee5 to your computer and use it in GitHub Desktop.
Python args template: read shell arguments
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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment