[PythonCE] baseHTTPServer and CGIHTTPServer
Ron Phillips
RPhillips at engineer.co.summit.oh.us
Tue Jan 4 20:32:42 CET 2005
When I run my little server.py in a subdirectory on Windows XP , it
knows where 127.0.0.1:54321/cgi-bin/response.py lives, and the browser
receives the appropriate codes from the response.py script.
However, when I move the script and server.py to the same file
structure on WindowsCE, server.py reports that it can't find
response.py. I believe this is simply another aspect of the fact that
WindowsCE doesn't recognize local files, and requires that all filenames
be fully specified. Is there a way to enter the URL into the browser
with the full path? Like: http://127.0.0.1:54321/program
files/python/htmlTest/cgi-bin/response.py" ? Or is it some other setting
that I need to specify, like some "base File" location that the server
then searches down from?
Server.py:
import BaseHTTPServer
import CGIHTTPServer
def run(server_class=BaseHTTPServer.HTTPServer,
handler_class=CGIHTTPServer.CGIHTTPRequestHandler,):
server_address=('',54321)
httpd = server_class(server_address,handler_class)
httpd.serve_forever()
run()
from the directory where server.py lives(C:/source) in XP, a file
called /cgi-bin/response.py is readily found when I put
"http://127.0.0.1/cgi-bin/response.py into the browser when
everything's on xp, but not when everything's on CE (/Program
Files/python/httpTest/). Server.py says it can't find the file.
Ron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/pythonce/attachments/20050104/aa1f8643/attachment.htm
More information about the PythonCE
mailing list