【发布时间】:2019-04-15 18:37:57
【问题描述】:
我有以下按预期执行的函数。
def get_files(paths):
for path in paths:
file_name = parse_path(path)
csv_command = "curl -b ./cookie {} > ./tmp/{}".format(path, file_name)
subprocess.run([csv_command], shell=True)
print("success")
我的问题是我也在从子流程中捕获标准输出。如何修改函数以忽略子流程中的标准。我将使用记录器进行记录,并且需要确保 STDout 仍会发生记录
【问题讨论】:
标签: python-3.x subprocess