importing files in python
Posted
by Yosy
on Stack Overflow
See other posts from Stack Overflow
or by Yosy
Published on 2010-03-27T13:42:05Z
Indexed on
2010/03/27
18:03 UTC
Read the original article
Hit count: 373
I have that file structure-
Blog\DataObjects\User.py
Blog\index.py
I want to import the function(say_hello) at User.py from index.py. I am trying this code -
from Blog.DataObjects.User import say_hello
say_hello()
And I have that error -
Traceback (most recent call last):
File "index.py", line 1, in <module>
from Blog.DataObjects import User
ImportError: No module named Blog.DataObjects
© Stack Overflow or respective owner