[Tutor] THE CGI SERVER SCRIPT
Kirk Bailey
idiot1 at netzero.net
Fri Sep 19 00:39:28 EDT 2003
Ole Jensen wrote:
> How does it work when importing modules?
Not bad, once you sneak them past customs...
> I am asking because I have been trying to get the CGIserver program to work
> with some problems I might add.
> However I got it working by changing this:
>
> import BaseHTTPServer, CGIHTTPServer
>
> to this:
>
> import BaseHTTPServerv
> import CGIHTTPServer
>
> I was under the impression that it was fully possiple to import two (and
> more) modules at the same time, besides Kirk apparently had the program
> working using the former code bit?
>
STEVE! STEVE! I JUST REPORT THE THING! STEVE HOLDEN! ARG! :-)
> Basically I'm asking this why was I not able to import both modules in one
> go?
>
That's odd; it works for me just fine. Could this be a quirk of a divferent
version of python? I am running 2.2.1; how about you?
>
>
>
>>STEVE wrote the server, I simply called a bug in it to his attention; he
>
> fixed
>
>>it. I used it, and made sure it was ok to give out copies, then offered it
>
> to you all.
>
> Hmm I should be able to remember that now, third time lucky, eh ;-)
>
>
> Just want to appolgies for the little late reply, work's been keeping me
> focused elsewhere...
>
> I set up a desktop shortcut like you described Kirk, but it still shut down
> right away, I'm expecting python to remain open but minimized.
>
> I have discovered something else though, the trace back that I get when
> running the server, is the same when I just open idle and try to import
> CGIHTTPServer.
>
> <code>
>
>>>>import CGIHTTPServer
>
> Traceback (most recent call last):
> File "<pyshell#0>", line 1, in ?
> import CGIHTTPServer
> File "C:\PROGRA~1\python\lib\CGIHTTPServer.py", line 28, in ?
> import SimpleHTTPServer
> File "C:\PROGRA~1\python\lib\SimpleHTTPServer.py", line 17, in ?
> import cgi
> File "C:\Programmer\python\cgi.py", line 3, in ?
> httpd=BaseHTTPServer.HTTPServer(('',80),
> CGIHTTPServer.CGIHTTPRequestHandler)
> AttributeError: 'module' object has no attribute 'CGIHTTPRequestHandler'
> <code>
>
> As can be seen I cannot even import the module without getting an error, I
> have tried to download an reinstall python (2.3) and still get the same
> result (the above trace back is copied from IDLE). I don't understand this I
> am sure that I have spelled it correct, and as
>
>
>
>
>
--
--
end
Cheers!
Kirk D Bailey
+ think +
http://www.howlermonkey.net +-----+ http://www.tinylist.org
http://www.listville.net | BOX | http://www.sacredelectron.org
Thou art free"-ERIS +-----+ 'Got a light?'-Prometheus
+ kniht +
Fnord.
More information about the Tutor
mailing list