I have classical python server. I made a CGI script. I would like from a click in the client side, execute a script in the server side and screen the result in the same page dynamically in the client side.
I know how to update dynamically a page in the client side but I didn't find a way to do it from the server side.
For instance my initial webpage:
print 'Content-type: text/html'# image/svg+xml'
print '''
<html>
<head>
</head>
<body>
<h1>My PAGE</h1>
<a href=#1" onclick="launcher(arg);">Execute my program</a>
<div id="1" style="display: none;" name="resul1"></div>
</body>
</html>
'''
I would like to execute a script in the server when we click like this kind of execution:
command = "python myscriptinLocal.py -a %s"%(arg)
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
process.wait()
A result file is generated in the server, and I would like to screen the result in the current page without to generated a new page....
Is it possible? Is there a way to do that with python or with another language?