prettier printer

This commit is contained in:
Adrien 2021-02-09 13:26:54 +01:00
parent b90e997119
commit 0ca041e6c8

View File

@ -15,12 +15,14 @@ if os.listdir("../../data/"):
tree = ET.parse("../../data/PrixCarburants_instantane.xml")
root = tree.getroot()
interesting_pomp = [item for item in root if item.attrib["cp"][:2] == "86"]
val = [
[(item[i].tag, item[i].attrib) for i in range(len(item))]
for item in interesting_pomp
]
for item in val[:3]:
print(parser(item))
for item in interesting_pomp:
print("Longitude :", item.attrib["longitude"], "\n")
print("Latitude :", item.attrib["latitude"], "\n")
print("Code Postal :", item.attrib["cp"], "\n")
for sub_item in item:
print(sub_item.tag, sub_item.attrib)
print("\n\n")
else: