argparse

 

import argparse    

parser = argparse.ArgumentParser()
#parser = argparse.ArgumentParser(prog='It\'s a cool job!', usage='U can use it', description='It\'s description',  epilog='It\'s EPILOG')
parser.add_argument('--use_fp16', default=False, help='Use half floats instead of full floats if True.', action='store_true')
parser.add_argument('-a','--abc', help='a sourcedir')
parser.parse_args() 

 

 

D:\work_space\eclipse\Pydev\src\com\now>python sd.py  -h
usage: sd.py [-h] [--use_fp16] [-a ABC]

optional arguments:
  -h, --help         show this help message and exit
  --use_fp16         Use half floats instead of full floats if True.
  -a ABC, --abc ABC  a sourcedir
D:\work_space\eclipse\Pydev\src\com\now>python sd.py  -a abc

 

posted @ 2019-04-16 19:55  牧 天  阅读(90)  评论(0)    收藏  举报