1. 首页
  2. 数据库
  3. 其它
  4. python subprocess pipe 实时输出日志的操作

python subprocess pipe 实时输出日志的操作

上传者: 2021-02-23 16:43:24上传 PDF文件 34.77KB 热度 22次
* test11.py import time print 1 time.sleep(2) print 1 time.sleep(2) print 1 time.sleep(2) print 1 * test.py import subprocess p = subprocess.Popen(“python test11.py”, shell=True, stdout=subprocess.PIPE) # None表示正在执行中 while p.poll() is None: out = p.stdout.readline() if out !
下载地址
用户评论