Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > cannot create python packages

Reply
Thread Tools

cannot create python packages

 
 
Konstantinos Pachopoulos
Guest
Posts: n/a
 
      10-10-2007
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
 
Reply With Quote
 
 
 
 
mauro
Guest
Posts: n/a
 
      10-10-2007
On 10 Ott, 15:01, Konstantinos Pachopoulos <(E-Mail Removed)>
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Python Packages : A loomingproblem? packages might no longer work? (well not on your platform or python version anyway) David Lyon Python 19 04-23-2009 11:10 PM
Cannot debug web application "Cannot create/shadow copy ..." Waldy ASP .Net 4 08-03-2007 01:36 PM
Advice on converting hashed packages to pseudo-hashed packages Ian Perl Misc 3 02-12-2005 12:17 AM
Do the javax.imageio packages replace packages in com.sun.image? Paul Smith Java 0 11-18-2003 02:58 PM



Advertisments