I have a command line Python program that sometimes takes a bit (several minutes) to run. I want to provide an optional method for an impatient user (me!) to check the status of the program. The type and amount of status information doesn't fit nicely into a --verbose or logger -- either too little or too much information at different points.
I think an optional web page would be convenient interface. The Python program would listen on some port, and if queried (by me browsing to localhost:12345 for example) would return a pretty status display. Hitting reload would update the status etc. My problem is that I'm not sure how to do this: - I don't want to embed a full web server into the application or require any special PC setup. - I think I know how to listen on a socket, but not sure how to send stuff to to a web browser -- just start with <HTML>? Or like a CGI script with the header stuff like text/html? (I don't care if I have to write the HTML by hand or can use a toolkit -- not important). - Do I need a separate thread to listen and send the HTML? The application is currently single threaded. I'm confortable with threads, but would prefer to avoid them if possible. Or is there a better/different way of doing this? Any general advice or pointers to some code that already does this would be very much appreciated. Python 2.3, under both Linux & Windows if that makes a difference. Thanks, Brian. -- http://mail.python.org/mailman/listinfo/python-list