我正在调用这样的外部程序
call(["./myProgram", myArgs])
如何传递参数列表?myProgram 需要这样的 3 个参数
myProgram param1 param2 param3
像下面一样单独指定参数
call(["./myProgram", param1 ,param2, param3])
,但是如何使用参数列表/数组,例如
myArgs=[param1,param2,param3]
我得到这个
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/subprocess.py", line 493, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
raise child_exception TypeError: execv() arg 2 must contain only strings