This is a python newbie question:
I have the following directory structure:
test
-- test_file.py
a
-- b
-- module.py
where test
, a
and b
are folders. Both test
and a
are on the same level.
module.py has a class called shape
, and I want to instantiate an instance of it in test_file.py. How can I do so?
I have tried:
from a.b import module
but I got:
ImportError: No module named a.b
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…