I hacked away tonight, trying to make pyTDDmon support both Python 2 and 3 – at the same time. The last point is important, because I want pyTDDmon to stay a single-file distribution. I would say it worked better than I had expected.
Some of the changes I had to make includes:
1. ”import Tkinter” becomes ”import tkinter” in Python 3
2. def set_result(self, (green, total)) is not valid in Python 3. No support for ”tuple splitting”! Simple change: def set_result(self, green, total).
(don’t ask me why I used the tuple in the arguments of set_result. I have no good answer!)
3. All icon related code was commented out. It was not used anyway, and caused a hazard of encoding-problems (differences between Python 2 and 3 strings..)
I tested it with the following operating systems and Python versions:
– Windows + Python 2.7
– Windows + Python 3.2
– Ubuntu10.10 + Python 2.6
– Ubuntu10.10 + Python 2.7
– Ubuntu10.10 + Python 3.1
You can try this experimental version of pyTDDmon by downloading the development version of pyTDDmon.py. I am not daring enough to publish it as the stable version yet 😉