Skip to content

Instantly share code, notes, and snippets.

@suganoo
Created September 5, 2017 07:01
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 suganoo/c56aa12051f9cfd58f2dcc38999defff to your computer and use it in GitHub Desktop.
Save suganoo/c56aa12051f9cfd58f2dcc38999defff to your computer and use it in GitHub Desktop.
ArgumentParserの使い方
import argparse
if __name__ == "__main__":
### define config
parser = argparse.ArgumentParser(description='This script is ...')
parser.add_argument("-c", "--configpath", required=True, help='config file path')
parser.add_argument("-l", "--logtype", required=True, help='logtype ex. hogefuga')
args = parser.parse_args()
hg = Hogehoge(args.configpath, args.logtype)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment