Questions tagged «argh»

2
python argh / argparse:如何将列表作为命令行参数传递?
我正在尝试使用argh库将参数列表传递给python脚本。可以接受类似以下内容的东西: ./my_script.py my-func --argA blah --argB 1 2 3 4 ./my_script.py my-func --argA blah --argB 1 ./my_script.py my-func --argA blah --argB 我的内部代码如下所示: import argh @argh.arg('--argA', default="bleh", help='My first arg') @argh.arg('--argB', default=[], help='A list-type arg--except it\'s not!') def my_func(args): "A function that does something" print args.argA print args.argB for b in …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.