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 than go
to an HTML page.
Many thanks. 7 19396
Andrew Chalk: 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 than go to an HTML page.
IIUYC: make the link tot a Python CGI script instead of to an HTML page.
--
René Pijlman
"Andrew Chalk" <ac****@XXXmagnacartasoftware.com> wrote in message
news:tM*********************@newssvr11.news.prodig y.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 than go to an HTML page.
Do you want to run the script on the server or the client? If you
want to run it on the client, you can use Python instead of Javascript
(or in addition to Javascript) in the web page. Look at the <script>
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 would
invoke any other executable, and use the script name as the
first parameter.
John Roth Many thanks.
Thanks. I want to run the script on the server. The problem is that I don't
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?
Regards.
"John Roth" <ne********@jhrothjr.com> wrote in message
news:vn************@news.supernews.com... "Andrew Chalk" <ac****@XXXmagnacartasoftware.com> wrote in message news:tM*********************@newssvr11.news.prodig y.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 than
go to an HTML page.
Do you want to run the script on the server or the client? If you want to run it on the client, you can use Python instead of Javascript (or in addition to Javascript) in the web page. Look at the <script> 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 would invoke any other executable, and use the script name as the first parameter.
John Roth
Many thanks.
[Andrew Chalk] I want to run the script on the server.
Then you will need to figure out how to run the script on the server
;-)
If you're not aware of how to do this, then it's probably best for you
to read up on CGI, which is way of getting web servers to execute
scripts (in any language) when the scripts URL is requested.
The problem is that I don't 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?
Whatever is the URL of your script on your server. Examples include http://www.mydomain.com/cgi-bin/myscript.py http://www.mydomain.com/cgi-bin/myscript.cgi http://www.mydomain.com/cgi-bin/mysc...A=v1¶mB=v2
Your python script should then generate (i.e. print out) an HTML page
when it is run (actually it can generate anything, images included,
but HTML is a good place to start). The server takes the output of
your script and sends it to the requesting browser. The browser has no
way of knowing that the HTML did not come from a static file.
You can read about Python and CGI here:- http://starship.python.net/crew/dave....cgi?req=index
There are other "linkage mechanisms" by which you can cause the
execution of scripts on a server, e.g. mod_python, but none is
conceptually as simple as CGI. Also, CGI tends to be more portable
between different server software, and is almost always supported by
hosting providers.
HTH,
--
alan kennedy
-----------------------------------------------------
check http headers here: http://xhaus.com/headers
email alan: http://xhaus.com/mailto/alan
"Andrew Chalk" <ac****@XXXmagnacartasoftware.com> wrote in message
news:1t*********************@newssvr11.news.prodig y.com... Thanks. I want to run the script on the server. The problem is that I
don't 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? Regards.
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
to "fred.py."
John Roth
"John Roth" <ne********@jhrothjr.com> wrote in message news:vn************@news.supernews.com... "Andrew Chalk" <ac****@XXXmagnacartasoftware.com> wrote in message news:tM*********************@newssvr11.news.prodig y.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
than go to an HTML page.
Do you want to run the script on the server or the client? If you want to run it on the client, you can use Python instead of Javascript (or in addition to Javascript) in the web page. Look at the <script> 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
would invoke any other executable, and use the script name as the first parameter.
John Roth
Many thanks.
Thanks!
"Rene Pijlman" <re********************@my.address.is.invalid> wrote in
message news:1c********************************@4ax.com... Andrew Chalk: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 than
goto an HTML page.
IIUYC: make the link tot a Python CGI script instead of to an HTML page.
-- René Pijlman
Thanks!
"Alan Kennedy" <al****@hotmail.com> wrote in message
news:3F***************@hotmail.com... [Andrew Chalk] I want to run the script on the server.
Then you will need to figure out how to run the script on the server ;-)
If you're not aware of how to do this, then it's probably best for you to read up on CGI, which is way of getting web servers to execute scripts (in any language) when the scripts URL is requested.
The problem is that I don't 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?
Whatever is the URL of your script on your server. Examples include
http://www.mydomain.com/cgi-bin/myscript.py http://www.mydomain.com/cgi-bin/myscript.cgi http://www.mydomain.com/cgi-bin/mysc...A=v1¶mB=v2
Your python script should then generate (i.e. print out) an HTML page when it is run (actually it can generate anything, images included, but HTML is a good place to start). The server takes the output of your script and sends it to the requesting browser. The browser has no way of knowing that the HTML did not come from a static file.
You can read about Python and CGI here:-
http://starship.python.net/crew/dave....cgi?req=index
There are other "linkage mechanisms" by which you can cause the execution of scripts on a server, e.g. mod_python, but none is conceptually as simple as CGI. Also, CGI tends to be more portable between different server software, and is almost always supported by hosting providers.
HTH,
-- alan kennedy ----------------------------------------------------- check http headers here: http://xhaus.com/headers email alan: http://xhaus.com/mailto/alan This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: sarmin kho |
last post by:
Hi Python Guru,
I ve created a GUI using Boa constructor and am now trying to execute a python script when pressing a button on the GUI. So, there will then be two main threads running (the GUI...
|
by: wonder |
last post by:
Hi,
How can I pass the url of the current webpage link to a python script in
html?
thanks
sam
|
by: Dfenestr8 |
last post by:
Hi.
I've written a cgi messageboard script in python, for an irc chan I happen
to frequent.
Bear with me, it's hard for me to describe what the bug is. So I've
divided this post into two...
|
by: Olly |
last post by:
I've found a basic script, however I also need to add alt and title
attributes as well, how would I go about doing this?
Here's the script I found:
Thanks
<script language="JavaScript">
<!--...
|
by: olaufr |
last post by:
Hi,
I need to call a python script, with command line arguments (it is an
autonomous script with a __main__), from within another python script.
Can I use exec() or execfile() for this? How to...
|
by: Pankaj |
last post by:
I am facing a very basic problem as any new bie would face.
I know perl and now i want to use python
In perl, it is very simple , just
"perl scriptname.pl"
will execute the script.
But i...
|
by: phoolimin |
last post by:
Dear all,
I am trying to embed python into another scripting language, to do this
I need to solve a number of problems on importing or compiling python
script. First let me state what exactly I...
|
by: Chandra |
last post by:
Hi,
Is there a way to execute a python script(file) in ASP.NET application
(programmatically)??
Regards,
Chandra
|
by: Jorgen Bodde |
last post by:
Hi all,
This is slightly OT but it drives me nuts. Whenever I create a
shortcut in the start menu (in Windows) of a python script, it will
only execute it when the path where the script resides...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
|
by: Carina712 |
last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
|
by: BLUEPANDA |
last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
|
by: Rahul1995seven |
last post by:
Introduction:
In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
|
by: Ricardo de Mila |
last post by:
Dear people, good afternoon...
I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control.
Than I need to discover what...
|
by: ezappsrUS |
last post by:
Hi,
I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
|
by: jack2019x |
last post by:
hello, Is there code or static lib for hook swapchain present?
I wanna hook dxgi swapchain present for dx11 and dx9.
| |