show instant data on webpage

David Palao dpalao.python at gmail.com
Wed Jan 27 05:36:56 EST 2016


2016-01-26 18:26 GMT+01:00 mustang <mustang at nomail.it>:
>
>> 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?
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list

I'm not sure to understand how you are using php, but indeed you can
use python to plot data (have a look at matplotlib, for instance) and
also to make dynamic web pages (Flask, django).

Best.



More information about the Python-list mailing list