python 2to3手动修改
有没有办法手动将 python2.x 源代码更改为 python 3.x 。我想使用 lib2to3 可以做到这一点,但我不知道到底如何做到这一点?
Is there a way to change python2.x source code to python 3.x manually. I guess using lib2to3 this can be done but I don't know exactly how to do this ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,移植就是您在这里看到的。
移植是一项不平凡的任务,需要对代码做出各种决定。例如,您是否想要保持向后兼容性。没有单一、通用的移植解决方案。移植方式取决于您的具体要求。
我发现的将应用程序从 Python 2 移植到 3 的最佳资源是 wiki 页面 PortingPythonToPy3k。该页面包含多种移植方法以及许多对移植工作可能有帮助的资源链接。
Yes, porting is what you are looking here.
Porting is a non-trivial task that requires making various decisions about your code. For instance, whether or not you want to maintaing backward compatibility. There is no single, universal solution to porting. The way you port depends on your specific requirements.
The best resource I have found for porting apps from Python 2 to 3 is the wiki page PortingPythonToPy3k. The page contains several approaches to porting as well as a lot of links to resources that are potentially helpful in porting work.
谢谢。这是我一直在寻找的答案:
Thanks. Here is the answer I was looking for: