import subprocess ret = subprocess.Popen('netstat -ano',shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE) # PIPE管道 print(ret.stdout.read().decode('gbk')) # 需要解码 print(ret.stderr.read().decode('gbk')) # 需要解码
Python内置模块之subprocess
猜你喜欢
转载自www.cnblogs.com/wc89/p/10422937.html
今日推荐
周排行