我目前正在调试用Popen运行的cmd。
看上去:
cmd = ['test', 'arg1', 'arg2']
Popen(cmd)test是一个python脚本,我的计算机上有多个脚本。当我打电话给test时,我怎么知道哪个Popen()被接走了?
发布于 2015-10-24 01:02:27
如果您在Linux上,尝试对Popen()或subprocess.check_output()命令执行which命令,并将test作为参数传递。
例如:
>>> import subprocess
>>> subprocess.check_output(["which", "test"])
b'/Users/joeyoung/.virtualenvs/myproject/bin/test\n'https://stackoverflow.com/questions/33313403
复制相似问题