# -*- coding: CP936 -*-
import subprocess
cmd="cmd.exe"
begin=101
end=110
while begin<end:
#reload(sys)
#sys.setdefaultencoding('CP936')
p=subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE,stdin=subprocess.PIPE,stderr=subprocess.PIPE)
p.stdin.write("echo 你好."+str(begin)+"\n")
p.stdin.close()
p.wait()
print"excution result:\n"
pout=''.join(p.stdout.readlines())
output=pout.decode('cp936').encode('utf-8')
print"%s\n"% output
begin=begin+1
相关文章
- VIM、GVIM在WINDOWS下中文乱码的终极解决方案
- eclipse下properties文件中文乱码的解决方案
- ubuntu下 rar,zip等压缩文件中文件名乱码的解决方案
- 关于使用jsp时出现中文乱码的解决方案总结
- IE下get传中文乱码的问题完美解决方案
- 今天使用jspsmartupload.jar实现上传文件的功能,发现中文乱码,于是总结了下解决方法
- Python 3下Matplotlib画图中文显示乱码的解决方法
- java(jsp)使用MySql数据库,中文乱码的完整解决方案
- Linux下如何解压rar、zip格式文件?Linux VPS安装7zip/使用方法/压缩解压中文文件名乱码解决方案
- Python 使用PyMySql 库 连接MySql数据库时 查询中文遇到的乱码问题(实测可行) python 连接 MySql 中文乱码 pymysql库