Python 3 comes with a great tool to convert python 2 syntaxes to python 3. To convert the file, you simply have to use the command:
2to3 -w yourfile.py
On windows, this tool is usually located in the Tools/scripts folder inside your python installation folder. If you don't have this directory in your environment path. Use the command below.
cd c:\your\python\Tools\scripts\ python 2to3.py -w yourfile.py