J
Johny
I have this directory structure
C:
\A
__init__.py
amodule.py
\B
__init__.py
bmodule.py
\D
__init__.py
dmodule.py
and I want to import bmodule.py
C:\>cd \
C:\>python
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit
(Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.C:\>
so far so good. Now I would like to import bmodule but if the current
directory is \D subdirectory.
C:> cd \A\B\D
C:\A\B\D>
C:\A\B\D>python
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit
(Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named A.B
C:\>
so I can not import a module from the parent directory? Or where did I
make an error?
Thanks for help
L.
C:
\A
__init__.py
amodule.py
\B
__init__.py
bmodule.py
\D
__init__.py
dmodule.py
and I want to import bmodule.py
C:\>cd \
C:\>python
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit
(Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.C:\>
so far so good. Now I would like to import bmodule but if the current
directory is \D subdirectory.
C:> cd \A\B\D
C:\A\B\D>
C:\A\B\D>python
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit
(Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named A.B
C:\>
so I can not import a module from the parent directory? Or where did I
make an error?
Thanks for help
L.