Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5449

Python • Re: Converting w1thermsensor outputs to variables

$
0
0
@DS256
Thank you but how do I get from my current output to something like your 'reading' variable to be able to store the temperatures
You need to spend some time learning DICT and LIST.

Here's a sample to get you going

Code:

reading={"lake":{}, "shore":{}, "cottage":{}, "test":{} }temps={"air":0.0, "water":0.0, "inside":0.0}reading["lake"]=tempsreading["lake"]["water"]=22.2print(reading)

Statistics: Posted by DS256 — Sat Mar 30, 2024 7:11 pm



Viewing all articles
Browse latest Browse all 5449

Trending Articles