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 ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/NeoTech _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users