/usr/bin/env python, force a version

Roel Schroeven rschroev_nospam_ml at fastmail.fm
Thu Oct 6 08:03:06 EDT 2005


Laszlo Zsolt Nagy wrote:
> manatlan at gmail.com wrote:
> 
>> I've got a trouble, and i think that anybody there can help me
>>
>> I've got a python script which i distribute in somes packages for *nix.
>> This script is full of python and need python 2.4 ! And i'd like to
>> display a message when the user doesn't have a python2.4 version.
>>  
>>
>>>> import sys
>>>> sys.version
> '2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]'

Yes, but the problem is also that Debian (not only Sid, but also stable
and testing) has python 2.4 but it is not the default, i.e.
/usr/bin/python is a symlink to /usr/bin/python2.3 even if
/usr/bin/python2.4 is available to.

It would be nice if there was a general way to specify that a script
should be interpreted by python2.4, even if it is not the default, in a
way that works on all platforms. But I don't see how that should work.

-- 
If I have been able to see further, it was only because I stood
on the shoulders of giants.  -- Isaac Newton

Roel Schroeven



More information about the Python-list mailing list