python web server questions

D

dalebryan1

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top