使用脚本进行批量转换
1. 脚本目录:Python36Toolsscripts2to3.py
2. 打开cmd在命令行中切换到脚本所在目录,或将脚本复制到其他目录方便调用(切换盘符需加/d)
C:Usersceshi>cd /d d:pytestauto
3. 调用脚本批量转换pytest目录下的所有.py文件
d:pytestauto>python 2to3.py -w d:/pytest
4. 若只替换单个文件,则输入文件名
d:pytestauto>python 2to3.py -w ex32.py