title: Run a .exe file serverside by a CGI python script
body: <p>I have a html file with one button. When the button is clicked, a javascript function "run" is called:</p>
  
  <pre><code>function run() {
              window.open("http://localhost/cgi-bin/run.py", "_self");
          }
  </code></pre>
  
  <p>run.py is simply trying to run a helloworld.exe program, that outputs in a terminal the string "helloworld", but nothing happens, and browser keeps "waiting for localhost" indefinitely.</p>
  
  <pre><code>#!python
  import sys, string, os, cgitb
  
  cgitb.enable()
  os.system("helloworld.exe")
  </code></pre>
  
  <p>I have tried helloworld.exe alone and it works, I have run run.py on the terminal, and it worked, and also I have tested on the browser the test site <code>http://localhost/cgi-bin/helloworld.py</code>, and it worked fine (helloworld.py is another script just to see if my apache is configured OK).</p>
  
  <p>I am using wamp.</p>
  
  <p>What I am trying to do is a bigger program that allows a client connect to a server, and "interact" with a program on the server side. The program is already done in c++, and won't be translated into php or javascript.</p>
  
  <p>EDIT: I have been trying with the functions: subprocess.Popen, subprocess.call and os.system. I have also tested the code to run .exe files created by me living at apache/cgi-bin folder or executables like wordpad, living at c:\windows. And it always succeeds when the python script runs from the terminal, and it never works when trying from the browser. Is it possible that it is because of the server I am using?  I use the apache from wamp, and have added the sentence "AddHandler cgi-script .exe" to the httpd.conf file.</p>