On Tue, Aug 4, 2009 at 8:30 PM, Yinon Ehrlich <yinon...@gmail.com> wrote:

> Hi,
> Easy way to test for Python version:
> if sys.hexversion >= 0x2060100:
>  pass
>

Great suggestion. I just tested it on my newly installed Python 3.1 (as of
3.1r31)

>>> import sys
>>> "%X" % sys.hexversion
'30100F0'

That's genius - '301' for Python 3.1, and '00F0' is r31!

I'm definitely going to use this more often in the future.

Cheers,
Xavier
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to