#导入模块
import os
#操作
os.system("ipconfig")
#os.system默认打印执行结果
#subprocess.check_output不默认打印
#subprocess.check_call默认打印
#subprocess.Popen(["ping","www.jiepei.com"])非阻塞式调用
import subprocess
#subprocess.check_call("ping www.baidu.com")
#不会默认打印,且需要转码
out_bytes=subprocess.check_output(["ping","www.baidu.com"])
print(out_bytes.decode("gbk"))