title: Pass data from python script to HTML
body: <p>At this moment i have a python script running on a raspberry pi which generates data. I want to put this data on a webpage.</p>
  
  <p>I have installed an apache webserver on the pi and just put the generated data in the index.html</p>
  
  <pre><code>f = open("/var/www/index.html" ,"a")
      f.write("&lt;p&gt;'%s'&lt;/p&gt;" % (Y))
      f.close()
  </code></pre>
  
  <p>the downside is that i constantly need to refresh the browser to see if data changed.</p>
  
  <p>Is there a better way to do this? i have looked ad AJAX and PHP but i don't find a way to pass the data directlu from the script.</p>