title: Sending HTML form input to python script
body: <p>I'm trying to send a HTML form input from a page to a python script. This is just for testing purposes so ignore the poor code. Basically I don't know how to define the <code>action=</code> part to reference the <code>search()</code> function in the python script. I just need to get the basic functionality working. I'm using web2py as the framework which is probably relevant:</p>
  
  <p>Controller: default.py</p>
  
  <pre><code>def index():
      return dict()
  
  def search():
      import urllib
      q=request.vars.q
      result1 = urllib.urlopen('http://www.google.com/search?q=%s' % q)
      return dict(result1=result1)
  </code></pre>
  
  <p>default/search.html:</p>
  
  <pre><code>{{extend 'layout.html'}}
  &lt;form method=get action=???&gt;
  &lt;input name=q&gt;
  &lt;input type=submit value=search&gt;
  &lt;/form&gt;
  </code></pre>