Path to package

Tim Hochberg tim.hochberg at ieee.org
Tue May 30 10:43:04 EDT 2000


You could use the packages __path__ variable to find the html
files. For example.

import myPackage
htmlPath1 = myPackage.__path__ + os.sep + "htmlfilename1"
do_something_with(htmlpath1)
#....

-tim

ame at swipnet.se (Anders Eriksson) writes:

> I'm trying to create an CGI application which will use one of my
> package. In this package there are some HTML-files. If I have all
> files in the same directory, both my cgi application and the package,
> then the package will find the html-files. but if I separate them,
> like I want to, and put the cgi-file into cgi-bin and the package into
> site-packages, then the package will search for the html-file in the
> cgi-bin directory.
> 



More information about the Python-list mailing list