By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,084 Members | 1,214 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,084 IT Pros & Developers. It's quick & easy.

python web server questions

P: n/a
I am working on a task to display a wireless network nodes using
Google Earth (GE) with KML network links. I am using a simple python
webserver (see code below) to serve up the python scripts as KML
output to GE for this.

import BaseHTTPServer
import CGIHTTPServer
class Handler(CGIHTTPServer.CGIHTTPRequestHandler):
cgi_directories = ['/cgi-bin']
httpd = BaseHTTPServer.HTTPServer(('',8000), Handler)
httpd.serve_forever()

This works fine for my initial scripts, but now I thinking of
combining the python scripts into the server program and making things
more efficient. The script file currently reads sensor data from
different I/O ports (GPS ->serial, network data -ethernet). I am
new to python, and was wondering if there might be a better way to run
the server side process than how I am doing it now:

1. GE client requests data through KML network link on a periodic
update interval
2. python webserver handles request and executes python script in cgi-
bin directory
3. python script reads sensor input from serial and ethernet ports and
writes data as KML output to GE client
4. repeat process at update interval

I am thinking if it would be better to make the process server-side
focussed as opposed to client side. Have the server only update
sensor data to the client when there has been a change in sensor data,
and only send the data that has changed. Has anyone had experience in
doing this with python that could point me in the right direction?

thx
Dale
Dec 17 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.