社区微信群开通啦,扫一扫抢先加入社区官方微信群
社区微信群
参考内容:https://docs.python.org/zh-cn/3.7/library/2to3.html
然后新建文件:python 2to3.reg
文件内容:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOTPython.FileShelleditwithidleshell2to3command]
@="cmd /c C:\Users\Joe\AppData\Local\Programs\Python\Python37\Tools\scripts\2to3.py -w "%1""
其中C:\Users\Joe\AppData\Local\Programs\Python\Python37\Tools\scripts\2to3.py 为自己的文件路径路径。
找到自己python下的2to3.py 然后注意转义。
保存好了直接双击
会有提示:
点击确定
找到要转换的程序,右键
选择Edit with IDLE 然后选择 2to3
然后就转换成python3完成。
会在文件目录同时生成该文件的.bak文件,这是该文件python2的备份文件。
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!