FAQs
How do I port my existing scripts from Python 2.7 to Python 3?
Solution
You may wish to consult the official Python Software Foundation's guide.
Hopefully, your script was written with both Python 2.7 and 3.x in mind. The Python-Future's cheat sheet gives practical tips.
If your script does not contain from future import division
you will need to very carefully check all of the integer division operations in your code to ensure that results match between Python 2.7 and Python 3.x.
There are some known script changes that are needed if your script makes use of tkinter or winreg, as described below.
For Tkinter, please replace import Tkinter
with the following:
try:
import Tkinter
except ImportError:
import tkinter as Tkinter
try: import _winreg except ImportError: import winreg as _winreg