Python Getopt
# 参数说明
getopt.getopt(args, shortopts, longopts=[])
args 指的是当前脚本接收的参数,它是一个列表,可以通过 sys.argv 获得
shortopts 是短参数,例如 python test.py -h
longopts 是长参数,例如 python test.py --help
# 测试一
123456789101112import getoptimport sys# sys.argv[0] 是当前脚本文件名print(sys.argv[0]) # test.pyarg = getopt.getopt(sys.argv[1:],...
more...









