使用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  阅读(560)  评论(0)    收藏  举报