Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.python
Re: package import
Steve Holden
2/6/2008 4:53:00 AM
Sean Allen wrote:
> ok, what am i doing wrong?
>
> in current working directory i have:
>
> t.py
> sub/t1.py
>
> t.py is:
>
> import sub.t1
>
> i get:
>
> ImportError: No module named sub.t1
>
> t.py is
>
> import sub
>
> i get:
>
> ImportError: No module named sub.t1
>
> --
>
> i am obviously missing something really basic here.
> have tried on multiple machines, linux and mac os x.
>
Create an empty sub/__init__.py - then Python will recognize sub is a
package, and allow you to import modules from within it.
regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC
http://www.hold...
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: package import
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password