On Monday, February 27, 2017 at 6:02:24 PM UTC-5, Frank Johnson wrote:
>
> hi all:
>
> hope someone can point me in the right direction i have crated a csv
> file in raspberry pi reading data from the hat so im using the
> pond.py example but having problem reading multiple items my file just
> contains the data...
> ie
> 32.65,44.5,1015.6,2017-02-27 17:54:38.827595
> so i need to read that in as
> inTemp (value)
> inHumidity (value)
> barameter (value)
> datetime (value)
>
> im adding this in to argument the SDR info to complete the site is this
> even the right approach ??
>
you're spot on!
one way to parse comma-separated values looks something like this:
with open(filename) as f:
line = f.readline()
values = line.split(',')
record['inTemp'] = line[0]
record['inHumidity'] = line[1]
record['barometer'] = line[2]
you do not need the datetime field, since you are augmenting a packet that
already has one.
also, be sure to convert units if necessary. check the usUnits field to
see what unit system you should convert to.
m
--
You received this message because you are subscribed to the Google Groups
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.