python add_argument() 的使用方法
https://www.cnblogs.com/Allen-rg/p/12234237.html
import argparse parser = argparse.ArgumentParser(description = 'TEST') parser.add_argument ('--start-epoch', default = 0, type = int, help = 'please input number') parser.add_argument ('--batch_size', default = 64, type = int, help = ' number') def main(): global args args = parser.parse_args() print(args) print(args.start_epoch) if __name__ == '__main__': main()