B
blackwhite
[Code as follows:]
args_list, names = getopt.getopt( sys.argv[1:] , "n:j:h")
args = {}
for (a, v) in args_list:
args[a] = v
If i use cmd line as
xxx.exe -n A -j B 123.txt 456.jpg
The output will be
args_list will be[('-n','A'),('-j','B')]
names will be['123.txt','456.jpg']
args_list, names = getopt.getopt( sys.argv[1:] , "n:j:h")
args = {}
for (a, v) in args_list:
args[a] = v
If i use cmd line as
xxx.exe -n A -j B 123.txt 456.jpg
The output will be
args_list will be[('-n','A'),('-j','B')]
names will be['123.txt','456.jpg']