Skip to content

Instantly share code, notes, and snippets.

@fginter
Created May 30, 2014 12:59
Show Gist options
  • Save fginter/5ff47f6a43e7e058484a to your computer and use it in GitHub Desktop.
Save fginter/5ff47f6a43e7e058484a to your computer and use it in GitHub Desktop.
import argparse
if __name__=="__main__":
parser = argparse.ArgumentParser(description='Train')
parser.add_argument('-p', '--processes', type=int, default=4, help='How many processes to run?')
parser.add_argument('-o', '--output', required=True, help='Name of the output model.')
parser.add_argument('input', nargs='?', help='Training file name, or nothing for training on stdin')
args = parser.parse_args()
@fginter
Copy link
Author

fginter commented May 30, 2014

Just a little cut'n'paste-friendly note to self on how to use argparse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment