【发布时间】:2011-03-17 19:39:23
【问题描述】:
无论如何我可以写入临时文件并将其包含在命令中,然后关闭/删除它。我想执行命令,例如:some_command /tmp/some-temp-file。
非常感谢。
import tempfile
temp = tempfile.TemporaryFile()
temp.write('Some data')
command=(some_command temp.name)
temp.close()
【问题讨论】:
标签: python