Executing a python script from an HTML link?
newsgroups at jhrothjr.com
Tue Sep 23 20:03:27 CEST 2003
"Andrew Chalk" <achalk at XXXmagnacartasoftware.com> wrote in message
news:1t%bb.407$Q44.601209120 at newssvr11.news.prodigy.com...
> Thanks. I want to run the script on the server. The problem is that I
> have an html page as an HREF. Viz:
> <tr><A HREF="Fred.htm">Fred</A>
> What replaces Fred.htm to invoke a server-side script?
That's not a Python issue. It's a web server configuration
issue. You should be able to configure your web server
to recognize href="fred.py" as a request to run the fred.py
script using the Python interpreter, and pass back whatever
web page, graphic or other file it outputs. For that matter,
you might even be able to configure it to recognize
"Fred.htm" as a python script, and rewrite the name
> "John Roth" <newsgroups at jhrothjr.com> wrote in message
> news:vn0tdkg96jlcc7 at news.supernews.com...
> > "Andrew Chalk" <achalk at XXXmagnacartasoftware.com> wrote in message
> > news:tMYbb.382$zy3.566196578 at newssvr11.news.prodigy.com...
> > > Is this possible? In my CGI app. I display a web page with a link
> > (anchor).
> > > When the link is clicked I want to exectute a python script rather
> > > to an HTML page.
> > Do you want to run the script on the server or the client? If you
> > tag for the language (I think that's the one - I haven't looked it up
> > recently) attribute. Otherwise, just invoke Python the same way you
> > invoke any other executable, and use the script name as the
> > first parameter.
> > John Roth
> > >
> > > Many thanks.
> > >
> > >
More information about the Python-list