making it readable

This commit is contained in:
chrissy 2026-04-06 22:14:21 +02:00
parent bd6463d038
commit 478a2d2b6f
1 changed files with 3 additions and 2 deletions

5
efa.py
View File

@ -18,7 +18,7 @@ def searchStop(name):
points = x["Points"] points = x["Points"]
stops = [] stops = []
for Point in x["Points"]: for Point in x["Points"]:
stops.append([Point.split(sep="|")[0], Point.split(sep="|")[3]]) stops.append([Point.split(sep="|")[0], Point.split(sep="|")[3], Point.split(sep="|")[2]])
return stops return stops
@ -26,10 +26,11 @@ def searchStop(name):
def selectStop(stops): def selectStop(stops):
print("Your query matches the following stops:\n") print("Your query matches the following stops:\n")
for i, stop in enumerate(stops): for i, stop in enumerate(stops):
print(f"({i}) {stop[1]}") print(f"({i:>2d}) {stop[1]}, {stop[2]}")
selection = int(input("\nPlease select... ")) selection = int(input("\nPlease select... "))
stopId = stops[selection][0] stopId = stops[selection][0]
stopName = stops[selection][1] stopName = stops[selection][1]
stopCity = stops[selection][2]
return stopId, stopName return stopId, stopName