distutils: package data

Serge Orlov Serge.Orlov at gmail.com
Wed Mar 30 11:33:02 CEST 2005


Qiangning Hong wrote:
> ehh..  I did a little more reading and found that this function can
> be easily done by the new distutils parameter "package_data" in 2.4.
>
> However, I am using python2.3 :(
>
> So, my question becomes: how to emulate the package_data function in
> python 2.3?

There is distutils.sysconfig.get_python_lib() that works at least
since 2.2:

>>> from distutils import sysconfig
>>> sysconfig.get_python_lib()
'/usr/lib/python2.2/site-packages'

>>> from distutils import sysconfig
>>> sysconfig.get_python_lib()
'/usr/lib64/python2.3/site-packages'

>>> from distutils import sysconfig
>>> sysconfig.get_python_lib()
'c:\\python24\\Lib\\site-packages'

  Serge.




More information about the Python-list mailing list