Now compiles using Python 3.3
I have made some simple changes to the code to make it compile using Python 3.3.
Please use if you think it's worth it :)
Thanks! I'll give this a shot on my own setup and merge if all goes well.
Would it be possible to make this compatible with 2.7 as well? Most distros still have Python 2.x by default, so I'd rather not break compatibility.
It is possible, check this article: http://docs.python.org/py3k/howto/pyporting.html which has more info than I can give you here.
One of the points (which sounds better than the rest) recommends to decide which version you want to maintain, and then use 2to3 or 3to2 port utility. This is better explained here: http://docs.python.org/py3k/howto/pyporting.html#use-3to2.
I could work on this when time permits, but the taken approach should be decided by you probably :)
I'm going to try supporting both, but if that won't play nice then I'm going to merge this as-is and leave a note somewhere about 3to2. The __ future __ stuff doesn't look too bad.
edit: today I learned: double underscore is bold.
I think for the moment 2.7 is still the most widely available Python version, though for supporting 2.6 - 3.x in one codebase you could use from __future__ import print_function and then import urlopen specifically:
if sys.version_info[0] == 3:
from urllib.request import urlopen
else:
from urllib2 import urlopen
...
web = urlopen(...)
The writes to gl3w.c and gl3w.h would need to be changed to a raw unicode string rather than a raw string encoded as UTF-8 afterwards e.g. f.write(ur'''your text here''') instead of f.write(bytes(r'''your text here''',"UTF-8")) and with that done it should perform as intended on any 2.6+ interpreter.