What's the very simplest way to run some Python from a button on a web page?

tinnews at isbd.co.uk tinnews at isbd.co.uk
Sat Jan 21 09:58:39 EST 2012

I want to run a server side python script when a button on a web page
is clicked.  This is on a LAMP server - apache2 on xubuntu 11.10.

I know I *could* run it as a CGI script but I don't want to change the
web page at all when the button is clicked (I'll see the effect
elsewhere on the screen anyway) so normal CGI isn't ideal.

It's easy to show a button:-

    <INPUT TYPE=submit NAME="Button" ONCLICK=something>;

Can I get away with something clever for 'something' that will somehow
hook through to a server side script?

Alternatively, seeing as both client and server are on the same
system, this *could* be done on the client side by breaking out of the
browser sandbox - is there any easy way to do this?

I'm just looking for the crudest, simplest possible way of doing this,
it's only for my own convenience to fire up a utility I want to use
when viewing certain of my local HTML pages.  These pages aren't
visible from the outside world so security isn't a big issue.

Chris Green

More information about the Python-list mailing list