title: Run python script from HTML button
body: <p>I have a code to display the live camera footage on a HTML and I would like to have a button that allows users to ring the rpi buzzer. However, the buzzer button does not go through to the rpi no matter what I try.
  I'm fairly new to coding so I'm really not sure what I'm missing. Would appreciate all the help I can get.
  Here's part of what I have for now in my HTML.</p>
  
  <pre><code>&lt;form method = &quot;post&quot;&gt;
  
            &lt;a href=&quot;/ring&quot;&gt;
            &lt;button type=&quot;submit&quot;&gt;
            &lt;button&gt;                   
                  &lt;i class=&quot;fa fa-bell-o fa-2x&quot; style=&quot;color: white&quot; aria-hidden=&quot;true&quot;&gt;&lt;/i&gt;
            &lt;/button&gt;
          &lt;/a&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>main script</p>
  <pre><code>@app.route('/ring', methods=['GET', 'POST'])
  def ring():
      print(&quot;buzzer&quot;)
      GPIO.output(18,1)
      sleep(5)
      GPIO.output(18,0)
      sleep(0.5)
      return render_template('index.html')
  </code></pre>