From e0a9819d3f703d9cc6562d3972309d66252b2b2e Mon Sep 17 00:00:00 2001 From: TheDevKiller Date: Thu, 8 Nov 2018 00:06:37 +0100 Subject: [PATCH] Made lists of tuples with the corners of the polygon --- fetch.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/fetch.py b/fetch.py index d34a979..98e35be 100755 --- a/fetch.py +++ b/fetch.py @@ -30,9 +30,18 @@ if __name__ == '__main__': for index, zone in enumerate(diclist): for element in zone: diclist[index][element] = re.sub("", "\n", diclist[index][element]) # Replace
,
and
by \n - # Print the dict + # Make a the area + for area in diclist: + # Polygons + if "polygone" in area["zone"]: + lst = re.findall(".:(.*)\/(.*)", area["zone"]) + area["zone"] = lst + print(lst) + del lst + + # Print the dict (keep this code in the end of the file) print("===== Dict =====") - for index, zone in enumerate(diclist): + for index, area in enumerate(diclist): print(f"\n-------------{index}----------------\n") - for element in zone: + for element in area: print(f" {element}: {diclist[index][element]}") \ No newline at end of file