【发布时间】:2014-03-13 00:28:22
【问题描述】:
假设我有一个 Python 中的命令,看起来像
command = 'curl ...etc" > result.json'
subprocess.call(command, shell = True)
file = open("result.json").read()
它现在所做的是从我 curl 的地方获取 GET 并将结果存储在 result.json 中,然后我打开它来阅读它。不知道有没有什么方法可以直接读取而不需要先存储到本地?
【问题讨论】: