由于os.popen被subprocess.popen替换,我想知道如何转换
os.popen('swfdump /tmp/filename.swf/ -d')
到subprocess.popen()
我试过:
subprocess.Popen("swfdump /tmp/filename.swf -d")
subprocess.Popen("swfdump %s -d" % (filename)) # NOTE: filename is a variable
# containing /tmp/filename.swf
但我想我写得不对。任何帮助都将不胜感激。谢谢
使用sh,会让事情变得简单得多:
subprocess.Popen
接受参数列表:甚至还有一个section of the documentation专门用来帮助用户从
os.popen
迁移到subprocess
。相关问题 更多 >
编程相关推荐