Created
September 5, 2017 07:01
-
-
Save suganoo/c56aa12051f9cfd58f2dcc38999defff to your computer and use it in GitHub Desktop.
ArgumentParserの使い方
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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