I’m looking to build a ‘dashboard’ that takes band condition data from an xml url. The data is stored in a way that there is a tuple with multiple bits of information. I’d like to print the band conditions for each of the bands for day and night.
This will eventually be used in an epaper display and probably need circuit python but for now I am trying to understand the way to extract the band data and display it nicely. So the code is just a few lines for now
e.g. 80m-40m Day Poor
80m-40m Night Fair
This is to be repeated for each set of band (“30m-20m”,“17m-15m”,“12m-10m”)
Rather than call the xml url whilst I try and understand there is an xml file with the data in it called solar.xml
Repl link: https://replit.com/@g7kse/Solar-Data#main.py
import xml.etree.ElementTree as ET tree = ET.parse('solar.xml') root = tree.getroot() child = list(tree.iter()) findLoc = 0 txt = "" for band in root.iter('band'): txt = str(band.attrib) findLoc = txt.find('17') if findLoc > 0 : print (txt , band.text )