Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #19191

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

From tinnews@isbd.co.uk
Newsgroups comp.lang.python
Subject What's the very simplest way to run some Python from a button on a web page?
Date 2012-01-21 14:58 +0000
Message-ID <vd0ru8-mip.ln1@chris.zbmc.eu> (permalink)

Show all headers | View raw


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

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

What's the very simplest way to run some Python from a button on a web page? tinnews@isbd.co.uk - 2012-01-21 14:58 +0000
  Re: What's the very simplest way to run some Python from a button on a web page? Tim Roberts <timr@probo.com> - 2012-01-21 20:36 -0800
    Re: What's the very simplest way to run some Python from a button on a web page? Chris Angelico <rosuav@gmail.com> - 2012-01-22 15:52 +1100
      Re: What's the very simplest way to run some Python from a button on a web page? tinnews@isbd.co.uk - 2012-01-22 10:05 +0000
    Re: What's the very simplest way to run some Python from a button on a web page? tinnews@isbd.co.uk - 2012-01-22 10:04 +0000

csiph-web