[Tutor] Checking for Python version

Luke Paireepinart rabidpoobear at gmail.com
Tue Oct 6 16:50:10 CEST 2009


On Tue, Oct 6, 2009 at 4:47 PM, Wayne <srilyk at gmail.com> wrote:

>
> On Tue, Oct 6, 2009 at 9:46 AM, Steve Willoughby <steve at alchemy.com>wrote:
>
>> On Tue, Oct 06, 2009 at 09:42:04AM -0500, Wayne wrote:
>> > On Tue, Oct 6, 2009 at 9:26 AM, Christian Witts <cwitts at compuscan.co.za
>> >wrote:
>> > if sys.version < '2.4':
>> >    sys.exit("Need at least Python 2.4")
>> >
>> > AFAIK the string comparison is reliable
>>
>> Not quite. What happens when you compare '2.4' and '2.10'?
>>
>
> >>> '2.4' > '2.10'
> True
>
That was his point, 2.4 should be a lesser version than 2.10, so it should
not ask you to upgrade if you have 2.10, but this code will.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20091006/66766ae1/attachment-0001.htm>


More information about the Tutor mailing list