python中执行shell命令

时间:2019-02-18 17:01:22   收藏:0   阅读:134

查看输出结果

import os
output = os.popen(cat 6018_gap_5_predict/solusion2/solusion2_0-1.txt | wc -l)
print(The last ,463719-int(output.read()))

 

其他方法:

https://www.cnblogs.com/hei-hei-hei/p/7216434.html

【注】commands 只有在py2中有

原文:https://www.cnblogs.com/TreeDream/p/10396332.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!