Khader Syed

Porting code from Python 2 to Python 3

Thu Sep 17 2015

#python#code

This page documents all the little changes between Python 2 and Python 3. Useful, so you can already start programming for the future and dropping the old ways of doing things.

So much has changed between Python 2 and Python 3, there are vanishingly few programs that will run unmodified under both. But don’t despair! To help with this transition, Python 3 comes with a utility script called 2to3, which takes your actual Python 2 source code as input and auto-converts as much as it can to Python 3.

Also, generators are awesome.