摘要: ``` import os, sys sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) ``` 阅读全文
posted @ 2019-09-17 19:50 雪山飞猪 阅读(661) 评论(0) 推荐(0) 编辑
摘要: 运行前指定export PYTHONIOENCODING为utf 8 如 阅读全文
posted @ 2019-09-17 17:25 雪山飞猪 阅读(5476) 评论(0) 推荐(0) 编辑
摘要: 1.使用readline可以实现 2.readline可能导致卡死,官方推荐使用communicate,但是如果还是使用subprocess.PIPE,执行完命令后才能拿到标准输出,替换成sys.stdout就能达到实时输出效果,代码附上 阅读全文
posted @ 2019-09-17 10:50 雪山飞猪 阅读(10478) 评论(3) 推荐(0) 编辑