使用subprocess库

import subprocess
out_bytes = subprocess.check_output(['netstat','-a'])

out_bytes = subprocess.check_output('grep python j wc > out', shell=True)

 

posted on 2018-05-08 17:49  Go_Forward  阅读(547)  评论(0编辑  收藏  举报