Python 2 to Python 3 conversion | Sololearn: Learn to code for FREE!


Python 2 to Python 3 conversion

This isn't a question, but in my research I read that many people don't know that you can auto convert your code from Python2 to 3. The process is built into Python3 and is called 2to3. Using $ 2to3 -w in the command line will update your code. Without the -w you'll just be shown the difference without it overwriting the file. This will be useful when you borrow code from somewhere else, like Github, but it's older. Here's the Python directory:

9/17/2021 2:20:25 PM


1 Answer

New Answer


That's usefull, thanks for letting us know