I’m new to programming and thought Python would be a good language to learn. Most of the tutorials I found were 2.7 based so I started to learn using that version. I’ve recently found a tkinter tutorial that I’d like to try out but I’m having a problem. If I run a script it will use Python 2.7 which contains Tkinter and not tkinter.
This problem made me think, how can I get my two versions to co-exist so I can program in both 2.x and 3.x?
I’m not sure I understand your question, but I’ll take a shot. I’m also assuming you’re on Windows.
It’s simple — just install both. They will install to different directories, create different start menu folders, etc. I’d also reccomend PyWin32 for the PythonWin editor installed in both 2.7 and 3.2,
If you mean how do you write one script that works with either Python 2 or Python 3, look at http://docs.python.org/library/2to3.html