David Isaac wrote:
> Alan wrote:
> > I do not want to make any assumptions about
> > this particular package being on sys.path.
> > (I want a relative import, but cannot assume 2.5.)
>
>
> I should mention that to get around this I have
> been using
> sys.path.append(os.path.split(sys.argv[0])[0])
Alan wrote:
> I do not want to make any assumptions about
> this particular package being on sys.path.
> (I want a relative import, but cannot assume 2.5.)
I should mention that to get around this I have
been using
sys.path.append(os.path.split(sys.argv[0])[0])
in the script I care most about. I
Simon Forman wrote:
> I would assume (but I haven't checked) that this should work as long as
> delmepy (in your case PackageFolder) was somewhere on sys.path.
Sorry that was not clear:
I do not want to make any assumptions about
this particular package being on sys.path.
(I want a relative import
David Isaac wrote:
> Suppose I have inherited the structure
>
> PackageFolder/
> __init__.py
> mod1.py
> mod2.py
> SubPackageFolder/
> __init__.py
> mod3.py
>
> and mod3.py should really use a function in mod2.py.
> *Prior* to Python 2.5, what is
Suppose I have inherited the structure
PackageFolder/
__init__.py
mod1.py
mod2.py
SubPackageFolder/
__init__.py
mod3.py
and mod3.py should really use a function in mod2.py.
*Prior* to Python 2.5, what is the best way to access that?
(Please assu