title: Do something while exec is being executed
body: <p>I write a php script that calls a python script which returns an html table. the PHP script gets the HTML table from the python script and print it to the page.
  I use exec to run the python script and I print the return value. 
  This process takes a few seconds and I want to print a message to the user (only dots for a start) while he is waiting. This doesn't seem to work because I don't know how to tell the PHP "do something until exec is done".</p>
  
  <p>This is a how I run the python script (I am using '> /dev/null &amp;' so it won't wait for it to finish:</p>
  
  <pre><code>exec("c:\\windows\\system32\\cmd.exe /c c:\\Python27\\python.exe c:\\script.py".' '.$param1.' '.$param2.' '.'&gt; /dev/null &amp;', $return_data, $return_code);
  while(!(isset($return_code)))
  {
      echo '.';
  }
  </code></pre>
  
  <p>I realized that I do that because $return_code is getting set to 0 in the beginning. Is there another way to do it?</p>
  
  <p>Thanks!</p>