Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #102130

show instant data on webpage

From mustang <mustang@NOMAIL.it>
Newsgroups comp.lang.python
Subject show instant data on webpage
Date 2016-01-26 17:10 +0100
Organization Aioe.org NNTP Server
Message-ID <n885p7$1el2$1@gioia.aioe.org> (permalink)

Show all headers | View raw


I've built a sensor to measure some values.
I would like to show it on a web page with python.


This is an extract of the code:

file  = open("myData.dat", "w")

while True:
         temp = sensor.readTempC()
         riga = "%f\n" % temp
         file.write(riga)
         time.sleep(1.0)

file.close()

Until this all ok.
Then in PHP I read the file and show it on internet. It works ok but...
First problem. I've to stop the streaming with CTRl-C to load the PHP 
file because if I try to read during measurement I cannot show anything 
(I think because the file is in using).
How can I show time by time in a webpage the output?

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

show instant data on webpage mustang <mustang@NOMAIL.it> - 2016-01-26 17:10 +0100
  Re: show instant data on webpage David Palao <dpalao.python@gmail.com> - 2016-01-26 17:38 +0100
    Re: show instant data on webpage mustang <mustang@NOMAIL.it> - 2016-01-26 18:26 +0100
      Re: show instant data on webpage David Palao <dpalao.python@gmail.com> - 2016-01-27 11:36 +0100
        Re: show instant data on webpage mustang <mustang@NOMAIL.it> - 2016-01-27 16:36 +0100
          Re: show instant data on webpage Joel Goldstick <joel.goldstick@gmail.com> - 2016-01-27 10:49 -0500
            Re: show instant data on webpage mustang <mustang@NOMAIL.it> - 2016-01-27 18:20 +0100
      Re: show instant data on webpage "Peter Heitzer" <peter.heitzer@rz.uni-regensburg.de> - 2016-01-27 12:02 +0000
        Re: show instant data on webpage mustang <mustang@NOMAIL.it> - 2016-01-27 16:37 +0100
          Re: show instant data on webpage "Peter Heitzer" <peter.heitzer@rz.uni-regensburg.de> - 2016-01-27 16:47 +0000
            Re: show instant data on webpage mustang <mustang@NOMAIL.it> - 2016-01-27 18:21 +0100
              Re: show instant data on webpage Grant Edwards <invalid@invalid.invalid> - 2016-01-27 17:51 +0000
                Re: show instant data on webpage mustang <mustang@NOMAIL.it> - 2016-01-29 12:48 +0100
                Re: show instant data on webpage Joel Goldstick <joel.goldstick@gmail.com> - 2016-01-29 07:34 -0500
                Re: show instant data on webpage mustang <mustang@NOMAIL.it> - 2016-01-30 21:50 +0100
                Re: show instant data on webpage Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-01-30 21:33 +0000
                Re: show instant data on webpage mustang <mustang@NOMAIL.it> - 2016-01-31 20:19 +0100
                Re: show instant data on webpage Joel Goldstick <joel.goldstick@gmail.com> - 2016-01-31 14:48 -0500
                Re: show instant data on webpage mustang <mustang@NOMAIL.it> - 2016-02-21 18:36 +0100
  Re: show instant data on webpage Grobu <snailcoder@retrosite.invalid> - 2016-01-30 05:01 +0100

csiph-web