Python2移植Python3工具: 2to3 2to3 #顯示原始的2.x版本與生成的3.x版本的區別 $ 2to3 foo.py #生成3.x版本,命名為foo.py;2.x版本重命名為foo.py.bak $ 2to3 -w foo.py