Comm. between Python and PHP

Peter Hansen peter at engcorp.com
Tue Feb 22 13:23:08 EST 2005


Nils Emil P. Larsen wrote:
> I'm building a daemon in Python. It will measure and control some
> physical devices on a serial bus. Since it is a daemon, it will never
> terminate and I can't interfere with the regulation of the devices by
> using command line parameters. I want to control the regulation by
> using a Internet browser.
> 
> What is the easiest way to make my threaded Python daemon communicate
> with a PHP-script running from Apache2 on localhost?

"Easiest" of course depends on lots of things, and mostly on
specifics that you haven't told us, and your personal preference.

Two obvious possibilities that come to mind are "write a file
somewhere from PHP and poll for updates from Python", and
"use sockets (TCP)" or "use UDP".

Maybe if you can describe more about what you need (e.g. what
form will this "control" take?) some even simpler suggestions
will come to mind.

-Peter



More information about the Python-list mailing list