prettier printer

This commit is contained in:
Adrien 2021-02-09 13:26:54 +01:00
parent b90e997119
commit 0ca041e6c8
1 changed files with 8 additions and 6 deletions

View File

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