Re: No module named server

2010-05-07 Thread Andi Albrecht
Thomas Lehmann  schrieb:
> Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit
> (Intel)] on win32
>
> Script:
> from http.server import HTTPServer, CGIHTTPRequestHandler
>
> Result:
> Traceback (most recent call last):
>   File "http.py", line 1, in 
> from http.server import HTTPServer, CGIHTTPRequestHandler
>   File "F:\Checkouts\projects\python\http.py", line 1, in 
> from http.server import HTTPServer, CGIHTTPRequestHandler
> ImportError: No module named server

You should rename http.py since it collides with the "http" module
you're trying to import the server and request handler classes from.

Andi
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: importing modules

2010-05-07 Thread Andi Albrecht
Richard Lamboj  schrieb:
>
> Hello,
>
> I have a question about importing python modules.
>
> I have modul package, with submodules. So how can a  submodul access a modul 
> that is on level upper?
>
> Is there something like "import ../../blah"? I don't mean something like 
> this: "import bla.blub.moep"
>
> Kind Regards,
>
> Richi

Hi Richi,

starting with 2.5 Python allows relative imports, e.g. import ..blah

Andi
-- 
http://mail.python.org/mailman/listinfo/python-list