Library and real path name

Robert Kern rkern at ucsd.edu
Tue Aug 23 06:08:59 EDT 2005


Michele Petrazzo wrote:
> I want to redistribute the library that I create.
> I create a project, its setup.py that when launched copy all files into
> the "site-packages/library" directory. And here it's all ok.
> When I call my library with:
> 
> import library
> library.class()
> 
> I want that my library know where are its real path
> (site-packages/library/), because it has to load a data file present
> into a subpackage directory (like site-package/library/data/file.dat),

http://peak.telecommunity.com/DevCenter/PkgResources

-- 
Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter




More information about the Python-list mailing list