import subprocessres = subprocess.Popen('dir',shell=True,stdout=subprocess.PIPE,stdin=subprocess.PIPE,stderr=subprocess.PIPE)print(res.stdout.read().decode('gbk'))