title: How do I get this radio on and off to work with the python file below
body: <p>webpage HTML code </p>
  
  <pre><code>&lt;form action="/cgi-bin/lights.py" method="POST"&gt;
  &lt;input type="radio" name="lighton" value="on"&gt;On&lt;br&gt;
  &lt;input type="radio" name="lightoff" value="off"&gt;Off
  &lt;br&gt;
  &lt;input type="submit" value="Submit"&gt;  
  &lt;input type="reset" value="Reset"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Python code that I want to turn the light on with is just need to figure out how to add them to the file below:</p>
  
  <pre><code>pl = pilight.PILIGHT()
  pl.createPiLight(255,255,255)
  </code></pre>
  
  <p>Python file:</p>
  
  <pre><code>#!/usr/bin/env python
  import cgi
  import cgitb
  import time
  import os, sys
  import pilight
  cgitb.enable()
  
  print "Content-type: text/html\n\n"
  form=cgi.FieldStorage()
  
  if "light" not in form:
      print "&lt;h1&gt;Neither radio button was selected.&lt;/h1&gt;"
  else:
      text=form["light"].value
      print "&lt;h1&gt;Radio button chosen:&lt;/h1&gt;"
      print cgi.escape(text)
      print "Check that Pi-Light is working correctly"
  </code></pre>
  
  <p>ON Condition:</p>
  
  <pre><code>pl = pilight.PILIGHT()
  pl.createPiLight(255,255,255)
  </code></pre>
  
  <p>OFF Condition:</p>
  
  <pre><code>pl = pilight.PILIGHT()
  pl.createPiLight(000,000,000)
  </code></pre>