Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Peter Heitzer" Newsgroups: comp.lang.python Subject: Re: show instant data on webpage Date: 27 Jan 2016 12:02:58 GMT Lines: 20 Message-ID: References: X-Trace: individual.net 1gYCNuujaJkVGKGViotfHgWKQlSmwflUIQdG8ainPYTmcUgNdl5a1g6sdN X-Orig-Path: not-for-mail Cancel-Lock: sha1:nz8VDOiAQg5ZlX7E40Qr2HJtLq0= User-Agent: tin/2.2.1-20140504 ("Tober an Righ") (UNIX) (Linux/3.16.0-4-amd64 (x86_64)) Xref: csiph.com comp.lang.python:102152 mustang wrote: >> open("myData.dat", "w").close() >> >> while True: >> temp = sensor.readTempC() >> riga = "%f\n" % temp >> with open("myData.dat", "a") as f: >> f.write(riga) >> time.sleep(1) >yes great it works!thanks a lot! >Anyway to refresh temperature I've to recall anytime the php page. >My idea is to read for example the first line every x seconds...it >should work. >Is it possible to use python and not php to plot data? You even could use python for the webserver. Read the docs for the module "SimpleHTTPServer".