import os
#py2file_path 需要转换的文件路径
pycode2to3=r"python D:\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\Tools\Scripts\2to3.py -w "+py2file_path
print(os.popen(pycode2to3,'r').read())
#py2file_path 需要转换的文件路径
#2to3.py python3.x自带的将2.x转换成3.x的程序
py2file_path=r'D:\File\python\2to3\0818_2.py'pycode2to3=r"python D:\WinPython-64bit-3.4.4.2\python-3.4.4.amd64\Tools\Scripts\2to3.py -w "+py2file_path
print(os.popen(pycode2to3,'r').read())