//目录

python中执行shell命令

查看输出结果

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中有

posted @ 2019-02-18 16:30  小草的大树梦  阅读(209)  评论(0编辑  收藏  举报