[Pythonmac-SIG] working around versions
Ronald Oussoren
ronaldoussoren at mac.com
Mon Nov 5 15:37:50 CET 2007
On 5 Nov, 2007, at 3:51, David Worrall wrote:
> Hi All,
>
> We're doing some work around different versions of Python on OSX (and
> what's in their respective site-packages directory),
> and I was wondering:
>
> Given that we can pick up the the version number of the current
> instantiation using sys.version,
> is there a direct way of computing the locating values for x and y in
> '/Library/Frameworks/Python.framework/Versions/Current/lib/pythonx.y/'
>
> other than through concatenating the above string with a splice of
> sys.version?
No.
BTW. The library location is os.path.join(sys.prefix, 'lib', 'python%d.
%d'%(sys.version_info[:2])). This should resolve to a path that
doesn't refer to 'Versions/Current' but to 'Versions/x.y'. Do not
assume that the 'Current' link will point to currently running
version of Python, a user might have installed multiple versions of
python.
Ronald
>
>
> thanks,
>
> David
> _________________________________________________
> experimental polymedia: www.avatar.com.au
> Sonic Communications Research Group,
> University of Canberra: creative.canberra.edu.au/scrg/
>
>
> _______________________________________________
> Pythonmac-SIG maillist - Pythonmac-SIG at python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2224 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20071105/db67f29b/attachment.bin
More information about the Pythonmac-SIG
mailing list