def test():
build_command = "耗时命令"
p = subprocess.Popen(
build_command,
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
)
while True:
if p.poll() is None:
print(f"编译进行中")
line = p.stdout.readline()
print(line)
else:
print(f"编译结束")
break
python 动态获取缓存输出
最新推荐文章于 2022-11-16 10:40:51 发布