[Tutor] THE CGI SERVER SCRIPT
Ole Jensen
learning.python at dbmail.dk
Thu Sep 18 20:16:29 EDT 2003
How does it work when importing modules?
I am asking because I have been trying to get the CGIserver program to work
with som 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?
Basically I'm asking this why was I not able to import both modules in one
go?
> 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
More information about the Tutor
mailing list