471,337 Members | 1,078 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

cannot create python packages

Hi,
i have the following files:
current_dir/level1/Called.py
current_dir/Caller.py
Called.py:
-----------
class Called:
def exec1(self):
print "Hello"
Caller.py:
----------
from level1.Called import *

c=Called()
c.exec1()

However it is impossible for Caller.py to find
Called.py. I even tried to place the level1 structure
inside /usr/lib/pythonX.Y/, whithout success however.
Any ideas?

Thnx
__________________________________________________ _________
Want ideas for reducing your carbon footprint? Visit Yahoo! For Good http://uk.promotions.yahoo.com/forgood/environment.html
Oct 10 '07 #1
1 991
On 10 Ott, 15:01, Konstantinos Pachopoulos <kostaspa...@yahoo.gr>
wrote:
Hi,
i have the following files:
current_dir/level1/Called.py
current_dir/Caller.py

Called.py:
-----------
class Called:
def exec1(self):
print "Hello"

Caller.py:
----------
from level1.Called import *

c=Called()
c.exec1()

However it is impossible for Caller.py to find
Called.py. I even tried to place the level1 structure
inside /usr/lib/pythonX.Y/, whithout success however.
Any ideas?

Thnx

__________________________________________________ _________
Want ideas for reducing your carbon footprint? Visit Yahoo! For Good http://uk.promotions.yahoo.com/forgood/environment.html
I think you need a __init__.py file in level1 directory

Oct 10 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Tim Bradshaw | last post: by
3 posts views Thread by Tim Gahnstrom | last post: by
2 posts views Thread by penglish1 | last post: by
7 posts views Thread by Edward Diener | last post: by
2 posts views Thread by diffuser78 | last post: by
2 posts views Thread by Gabriel Rossetti | last post: by
1 post views Thread by Martin Rubey | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.