我想使用argh库将参数列表传递给python脚本。 可以采取如下input的东西: ./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 args.argB: print int(b)*int(b) #Print […]