creating package question

erick_bodine at erick_bodine at
Thu Nov 17 17:15:12 CET 2005

Bruno Desthuilliers wrote:
> erick_bodine at a écrit :
> > I think I have an answer to my own question.  In the
> > WindowsComponents/ file, I have the following, that feels
> > like a better answer for the problem.  Is there a better answer than
> > this?
> >
> > import os, sys
> > sys.path.append(os.path.join(os.getcwd(), 'Common'))
> >
> Err... if the script is called from somewhere else, this won't work.
> replace os.getcwd() with os.path.dirname(os.path.realpath(__file__))
Right, I anticipate the script(s) won't be called from elsewhere,
> Or better, use a .pth or add the needed path in your PYTHONPATH
THis would be ideal if I could gaurantee that the users (other software
testers) would install the *.pth file. 

thanks for all the suggestions.

More information about the Python-list mailing list