@mygovcoronanewsdesk · Post #12206 · 01.03.2023 г., 07:15
#Budget2023#UrbanPlanning
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #65 · 8 апр.
Небольшой трик с регулярными выражениями который редко вижу в чужом коде. Допустим, вам нужно распарсить простой текст и вытащить оттуда пары имя+телефон. Вернуть всё это надо в виде списка словарей. Возьмем очень простой пример текста. >>> text = ''' >>> Alex:8999123456 >>> Mike:+799987654 >>> Oleg:+344456789 >>> ''' Соответственно, для выделения нужных элементов будем использовать группы. Получится такой паттерн: (\w+):([\d+]+) Как мы будем формировать словарь из найденных групп? >>> import re >>> results = [] >>> for match in re.finditer(r"(\w+):([\d+]+)", text): >>> results.append({ >>> "name": match.group(1), >>> "phone": match.group(2) >>> }) >>> print(results) [{'name': 'Alex', 'phone': '8999123456'}, ...] Можно немного сократить запись используя zip >>> results = [] >>> for match in re.finditer(r"(\w+):([\d+]+)", text): >>> results.append(dict(zip(['name', 'phone'], match.groups()))) Но есть способ лучше! Это именованные группы в regex. Можно в паттерне указать имя группы и результат сразу забрать в виде словаря. >>> for match in re.finditer(r"(?P<name>\w+):(?P<phone>[\d+]+)", text): >>> results.append(match.groupdict()) То есть всё что я сделал, это добавил в начале группы (внутри сбокочек) такую запись: (?P<group-name>...) Теперь найденная группа имеет имя и можно обратиться к ней как к элементу списка >>> name = match['name'] Либо забрать сразу весь словарь методом groupdict() >>> match.groupdict() #tricks#regex
Пребарај: #urbanplanning
@mygovcoronanewsdesk · Post #12206 · 01.03.2023 г., 07:15
#Budget2023#UrbanPlanning
Hashtags
@interesting_planet_facts · Post #1266 · 01.02.2026 г., 12:11
🌎 The ancient city of Mohenjo-daro in present-day Pakistan was part of the Indus Valley Civilization around 2500 BCE. It featured grid-planned streets, advanced drainage, brick houses, and a massive central bath. Mohenjo-daro was mysteriously abandoned by about 1900 BCE without clear evidence of war or disaster. ✨ #archaeology⚡#IndusValley⚡#urbanplanning 👉subscribe Interesting Planet 👉more Channels
@amazingeo · Post #552 · 02.01.2026 г., 20:31
🌍 Paris is creating "urban forests" by planting patches of dense woodland in city plazas and streets. These mini-forests lower summer temperatures and boost urban biodiversity. ✨ #urbanplanning⚡#sustainability⚡#biodiversity⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels
@mygovcoronanewsdesk · Post #12208 · 01.03.2023 г., 09:20
भारत में अर्बन डेवलेपमेंट के दो प्रमुख पक्ष है- नए शहरों का विकास और पुराने शहरों में पुरानी व्यवस्थाओं का आधुनिकीकरणः प्रधानमंत्री #urbanplanning#budget2023#unionbudget2023 https://youtu.be/CEiyK3D4O-k
@amazingeo · Post #594 · 26.01.2026 г., 12:31
🌍 In Stockholm, almost every resident lives within 300 meters of green space thanks to city planning that weaves parks and nature into neighborhoods—boosting health and local biodiversity. ✨ #urbanplanning⚡#sustainability⚡#cities⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels
@amazingeo · Post #138 · 29.08.2025 г., 13:12
🌍 Curitiba, Brazil transformed bus transit by designing special lanes just for buses, boosting speed and cutting traffic. This inspired cities worldwide to rethink sustainable urban transport. ✨ #urbanplanning⚡#sustainability⚡#transport⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍
@amazingeo · Post #406 · 23.10.2025 г., 12:31
🌍 Copenhagen aims to become the world’s first carbon-neutral capital by 2025, using bike highways, wind energy, and smart urban drainage to cut emissions while keeping the city livable. ✨ #urbanplanning⚡#sustainability⚡#environment⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels
@amazingeo · Post #482 · 28.11.2025 г., 20:31
🌍 Singapore’s “park connector” network links a growing web of green trails and corridors across the city, letting wildlife and people travel between parks, even in dense urban neighborhoods. ✨ #urbanplanning⚡#sustainability⚡#wildlife⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels
@amazingeo · Post #631 · 14.02.2026 г., 12:31
🌍 Some cities recycle wastewater to irrigate parks, saving drinking water for people. This system helps lower water use and keeps urban landscapes greener even in dry climates. ✨ #urbanplanning⚡#sustainability⚡#water⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels
@amazingeo · Post #291 · 24.09.2025 г., 15:31
🌍 In Freiburg, Germany, whole neighborhoods are designed with solar panels, car-free streets, and green spaces. These urban plans cut energy use and make city life healthier and more sustainable. ✨ #urbanplanning⚡#sustainability⚡#energy⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels
@amazingeo · Post #250 · 17.09.2025 г., 00:12
🌍 Singapore manages stormwater with a vast network of rooftop gardens, ponds, and clever drainage, helping prevent floods while cooling the city and supporting urban wildlife. ✨ #urbanplanning⚡#sustainability⚡#Singapore⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍
@mappasaurusofficial · Post #298 · 06.04.2025 г., 15:13
🍀Build Sustainable Cities with Mappasaurus!🌐 🪄Empower Eco-Friendly Urban Planning: ⏺Optimize Resources: Utilize our maps for efficient resource allocation and green urban projects. ⏺Smart Routing: Reduce emissions with AI-driven routes that minimize travel times and fuel usage. 🦖Why MappaSaurus❓ ⏺Enhance Urban Resilience: Support sustainable development that adapts to environmental challenges. ⏺Encourage Community Involvement: Use transparent mapping to foster public participation in urban planning. ⚔️Shape Greener, Smarter Cities with Us ⏺ See how Mappasaurus leads the way in eco-friendly urban planning. 💯#Mappasaurus#SustainableCities#UrbanPlanning#EcoFriendly#SmartCities