<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.17092" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=348482920-10112010><FONT face=Arial
size=2>Hello,</FONT></SPAN></DIV>
<DIV><SPAN class=348482920-10112010><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=348482920-10112010><FONT face=Arial size=2>I'm writing my first
module that I intend to put under our company's "site-packages" directory for
everyone to use in their programs. The problem I'm having is that I want
to place files in a data directory under the module directory (under
site-packages) and I don't know how to set the path so I pick up the
files. If I use open('./data/myfile') I get the path of the file importing
the module (which could be just about anywhere). I've tried various
combinations using os.path.abspath() and os.path.dirname() but have the same
problem. Is there a way I can use files in the subdirectory (I really do
not want dozens more files in the main directory)?</FONT></SPAN></DIV>
<DIV><SPAN class=348482920-10112010><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=348482920-10112010><FONT face=Arial size=2>Thanks for your
help,</FONT></SPAN></DIV>
<DIV><SPAN class=348482920-10112010><FONT face=Arial
size=2>--greg</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV><font face="monospace"><br>
CONFIDENTIALITY NOTICE: This communication contains information <br>
intended for the use of the individuals to whom it is addressed <br>
and may contain information that is privileged, confidential or <br>
exempt from other disclosure under applicable law. If you are <br>
not the intended recipient, you are notified that any disclosure, <br>
printing, copying, distribution or use of the contents is prohibited. <br>
If you have received this in error, please notify the sender <br>
immediately by telephone or by returning it by return mail and then <br>
permanently delete the communication from your system. Thank you.</font></BODY></HTML>