Hi Thomas,
Done :) and it's been stable overnight, thanks again for the advice.
Colin
On Wed, May 8, 2019 at 1:59 AM Thomas Keffer wrote:
> You should terminate your lines with '\n', not '\r' when you write your
> file.
>
> while True:
> data, addr = sock.recvfrom(1024) # buffer size is 10
You should terminate your lines with '\n', not '\r' when you write your
file.
while True:
data, addr = sock.recvfrom(1024) # buffer size is 1024 bytes
print "Received message:", data
with open(fname, 'w') as f:
for ds in data.split(','):
f.write(ds + "\n")
-tk
On
Thanks Gary appreciate the thoughts, I'll try those out tomorrow
Colin
On Tue, 7 May 2019, 20:23 gjr80, wrote:
> A few thoughts. If it works sometimes and not others there must be a
> problem with either the consistency of the format of the data or the
> algorithm being used to parse the data.
A few thoughts. If it works sometimes and not others there must be a
problem with either the consistency of the format of the data or the
algorithm being used to parse the data. Can't say I am a big fan of slicing
in a situation like this, I think it can be a bit rigid at times. Maybe
consider
Well this is a little strange. This went fine for a while then stopped
again with pretty much the same error. It appears to be missing the
beginning of the first line in the file which is AQI25 = then gets the
reading which is 4.55
invalid literal for float(): 4.55#015AQI100 = 9.09#015AQIIndex =
1
Hi Thomas
Thanks for the quick reply. It was just the format, it needs the spaces so
each line in the text file is
AQI25 = 1.60
AQI100 = 3.30
AQIIndex = 6
AQICO2 = 683
Once I did that and checked the database after an archive period the fields
were populated
Does my section with the units
Hi, Colin
Does your text file use newlines ('\n') as line delineators? Perhaps it is
using the MS-DOS standard of '\n\r'? Examine the file carefully and make
sure it contains what you think it contains.
-tk
On Mon, May 6, 2019 at 8:05 PM Colin Larsen wrote:
> Hi all
>
> I'm trying to get Filep
Hi all
I'm trying to get Filepile working but have come across an error that I
don't understand. Any help appreciated. The database has been extended with
fields to match those below in the data file - am I just missing spaces in
the layout? Should it be AQI25 = 1.60 etc etc
Many thanks
This is