Hi,
I'm new to python and I face an issue:
I try to extend my SConstruct
file and to import a module located in a sub-directory of my project.
Here is my SConstruct
file:
import os, sys
sys.path.append(os.path.abspath(os.path.join('.', 'custom_dir')))
import mymodule
mymodule.foo()
Here is the mymodule.py
file, located into a subdirectory named custom_dir
:
def foo():
print 'foo'
I also have a __init__.py
file in my custom_dir
directory.
When I execute scons
:
File ".\SConstruct", line 22, in <module>
mymodule.foo()
AttributeError: 'module' object has no attribute 'foo'
If I do python.exe SConstruct
I got the same result.
What am I doing wrong here ?