|
From: Werner <wer...@gm...> - 2014-06-05 14:01:47
|
On 6/5/2014 15:45, "V. Armando Solé" wrote: ... >> You would use 'six' - https://pypi.python.org/pypi/six it is used by >> many packages including wxPython. >> >> import six >> >> if six.PY3: >> key = chr(event_key) >> >> else: >> key = unichr(event_key) >> > Just for info. > > I had never heard about six. Is there anything wrong using sys???: > > import sys > if sys.version < "3.0": > key = unichr(event_key) > else: > key = chr(event_key) > > Thanks, Using 'six' for just the above case is definitely overkill, but it has many more goodies in it to make py2/py3 single source code easier. Werner |