How to port Python 2 Code to Python 3 — Python 3.15.2 documentation
Navigation index modules | Python » 3.15.2 documentation » How to port Python 2 Code to Python 3 | Theme | How to port Python 2 Code to Python 3 ¶ Python 2 reached its official end-of-life at the start of 2020. This means that no new bug reports, fixes, or changes will be made to Python 2 - it's no longer supported: see PEP 373 and status of Python versions . If you are looking to port an extension module instead of pure Python code, please see ਐਕਸਟੈਂਸ਼ਨ ਮੋਡੀਊਲਾਂ ਨੂੰ Python 3 ਵਿੱਚ ਪੋਰਟ ਕਰਨਾ .
The archived python-porting mailing list may contain some useful guidance. Since Python 3.11 the original porting guide was discontinued. You can find the old guide in the archive . Third-party guides ¶ There are also multiple third-party guides that might be useful: Guide by Fedora PyCon 2020 tutorial Guide by DigitalOcean Guide by ActiveState Table of Contents How to port Python 2 Code to Python 3 Third-party guides This page Report a bug Improve this page Show source Show translation source « Navigation index modules | Python » 3.15.2 documentation » How to port Python 2 Code to Python 3 | Theme | © Copyright 2001 Python Software Foundation.
This page is licensed under the Python Software Foundation License Version 2. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. See History and License for more information. The Python Software Foundation is a non-profit corporation. Please donate. Last updated on ਨਵੰ 19, 2026 (09:42 UTC). Found a bug ? Created using Sphinx 9.1.1.