Guides 11791 Published by

Howtoforge showing you how to convert Python 2 code to Python 3.



Converting your Python 2 code to Python 3

Python 2 reached the end of life on January 1, 2020. Python 3 has been available since 2008, but converting from 2 to 3 has been slow because of dependencies on libraries that were not available in Python 3 initially, earlier versions of python 3 were slower than python 2 and also because Python 2 was working quite well for many people. The Python 2 End of Life means no more supported releases and no bug fixes from Python. Some Linux distributions such as Ubuntu and Red Hat will be supporting Python 2 for some time but migrating to Python 3 is a better solution.



Converting your Python 2 code to Python 3