无论如何我可以写入tempfile并将其包含在命令中,然后关闭/删除它.我想执行命令,例如:some_command/tmp/some-temp-file.
提前谢谢了.
import tempfile
temp = tempfile.TemporaryFile()
temp.write('Some data')
command=(some_command temp.name)
temp.close()
Run Code Online (Sandbox Code Playgroud) python ×1