为了账号安全,请及时绑定邮箱和手机立即绑定

如何用Python中的子进程重定向输出?

如何用Python中的子进程重定向输出?

慕容3067478 2019-07-08 12:41:45
如何用Python中的子进程重定向输出?我在命令行中所做的事情:cat file1 file2 file3 > myfile我想对python做什么:import subprocess, shlex my_cmd = 'cat file1 file2 file3 > myfile'args = shlex.split(my_cmd)subprocess.call(args)  # spits the output in the window i call my python program
查看完整描述

3 回答

  • 3 回答
  • 0 关注
  • 886 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号