title: How can my PHP code run when i submit a HTML form
body: <p>I am trying to make a website using python and in flask I have a webpage that has a submit button, when the button is pressed I need it to run a python file I have called Answers.py </p>
  
  <pre><code>from flask import Flask, request, render_template, send_from_directory
  
  app = Flask(__name__)
  @app.route('/help', methods=["GET","POST"])
  def help():
      return render_template("help.html")
  </code></pre>
  
  <p>the HTML code on the page is this and i am trying to get when the button is pressed it runs a php script that outputs the value from a separate python file, the output text.</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;form action="" method="post"&gt;
      &lt;button type="submit" name="sub" value="Hello world"&gt;Submit 
  call&lt;/button&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I have tried this php code in the same file as the HTML but nothing is output when I press the button, i'm new to php so i'm not sure what the problem is.</p>
  
  <pre><code>&lt;?php
  if(isset($_POST['sub']))
      {
          $result = exec("Python Path Answers.py /tmp");
          echo $result;
      }
  ?&gt;
  </code></pre>