show instant data on webpage
Peter Heitzer
peter.heitzer at rz.uni-regensburg.de
Wed Jan 27 07:02:58 EST 2016
mustang <mustang at nomail.it> 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".
More information about the Python-list
mailing list