Possible Duplicate:
How to import the src from the tests module in python
I want to call another module which is located in another dir. My code structor is
flask_beginner/
app.py
models/
__init__.py
user.py
tests/
__init__.py
user_test.py
I want to call user module from user_test.py. My user_test.py is like this..
import models.user
....
But it raise error that no module named models.user
Do you have any idea? My Python Version is 2.7.2.(with virtualenv)
Thanks in advance.
import sys
sys.path.append('PathToModule')
import models.user
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With