On Tue, Oct 6, 2009 at 9:59 AM, Didar Hossain wrote:
> Hi,
>
> I am using the following code to check for the Python version -
>
> import os
>
> t = os.sys.version_info[0:2]
> if (t[0] + t[1]) < 6:
Hmm, what would this give for Python 1.5? How about
if t < (2, 4):
> os.sys.exit("Need at least
I like Kent's "try" method to explicitly look for the "staticmethod"
call - it is Pythony :-)
Todd's graceful handling idea is a good one - will keep that for future use.
Christian's input about my kludge failing with the 3.x series is a
good catch, I didn't think about that.
Thanks to all of yo
On Tue, Oct 6, 2009 at 4:47 PM, Wayne wrote:
>
> On Tue, Oct 6, 2009 at 9:46 AM, Steve Willoughby wrote:
>
>> On Tue, Oct 06, 2009 at 09:42:04AM -0500, Wayne wrote:
>> > On Tue, Oct 6, 2009 at 9:26 AM, Christian Witts > >wrote:
>> > if sys.version < '2.4':
>> >sys.exit("Need at least Python 2
Todd Zullinger wrote:
Christian Witts wrote:
Your version will fail if the person is running Python 3.0, 3.1 up
until the 3.3 series which is not good. Neater looking (imo) code
below.
from sys import version_info, exit
if version_info[0] == 1 or (version_info[0] == 2 and version_info[1] <
Didar Hossain wrote:
Hi,
I am using the following code to check for the Python version -
import os
t = os.sys.version_info[0:2]
if (t[0] + t[1]) < 6:
os.sys.exit("Need at least Python 2.4")
del t
This snippet is put at the beginning of the single script file before
the rest of the code.
I
On Tue, Oct 6, 2009 at 9:57 AM, Steve Willoughby wrote:
> On Tue, Oct 06, 2009 at 09:47:43AM -0500, Wayne wrote:
> > On Tue, Oct 6, 2009 at 9:46 AM, Steve Willoughby
> wrote:
> >
> > > On Tue, Oct 06, 2009 at 09:42:04AM -0500, Wayne wrote:
> > > > On Tue, Oct 6, 2009 at 9:26 AM, Christian Witts
Christian Witts wrote:
> Your version will fail if the person is running Python 3.0, 3.1 up
> until the 3.3 series which is not good. Neater looking (imo) code
> below.
>
> from sys import version_info, exit
>
> if version_info[0] == 1 or (version_info[0] == 2 and version_info[1] < 4):
>exit("
On Tue, Oct 06, 2009 at 09:47:43AM -0500, Wayne wrote:
> On Tue, Oct 6, 2009 at 9:46 AM, Steve Willoughby wrote:
>
> > On Tue, Oct 06, 2009 at 09:42:04AM -0500, Wayne wrote:
> > > On Tue, Oct 6, 2009 at 9:26 AM, Christian Witts > >wrote:
> > > if sys.version < '2.4':
> > >sys.exit("Need at l
On Tue, Oct 6, 2009 at 9:46 AM, Steve Willoughby wrote:
> On Tue, Oct 06, 2009 at 09:42:04AM -0500, Wayne wrote:
> > On Tue, Oct 6, 2009 at 9:26 AM, Christian Witts >wrote:
> > if sys.version < '2.4':
> >sys.exit("Need at least Python 2.4")
> >
> > AFAIK the string comparison is reliable
>
>
On Tue, Oct 06, 2009 at 09:42:04AM -0500, Wayne wrote:
> On Tue, Oct 6, 2009 at 9:26 AM, Christian Witts 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'?
--
Steve Wi
On Tue, Oct 6, 2009 at 9:26 AM, Christian Witts wrote:
> Didar Hossain wrote:
>
>> Hi,
>>
>> I am using the following code to check for the Python version -
>>
>> import os
>>
>> t = os.sys.version_info[0:2]
>> if (t[0] + t[1]) < 6:
>>os.sys.exit("Need at least Python 2.4")
>> del t
>>
>> This
Didar Hossain wrote:
Hi,
I am using the following code to check for the Python version -
import os
t = os.sys.version_info[0:2]
if (t[0] + t[1]) < 6:
os.sys.exit("Need at least Python 2.4")
del t
This snippet is put at the beginning of the single script file before
the rest of the code.
I
Hi,
I am using the following code to check for the Python version -
import os
t = os.sys.version_info[0:2]
if (t[0] + t[1]) < 6:
os.sys.exit("Need at least Python 2.4")
del t
This snippet is put at the beginning of the single script file before
the rest of the code.
I need to check for the
13 matches
Mail list logo