@googlefactss · Post #40017 · 05.11.2025 г., 08:17
One of the main differences between frogs and toads is that frogs need to stay by water to survive, whereas toads can survive without constant access to moisture. @googlefactss#amphibians
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #121 · 20 јул.
Регулярно требуется преобразовать какой-либо текст в максимально совместимый текст для URL, имени файла, имени объекта в каком-то софте и тд. Требования совместимости простые: в тексте должны быть только допустимые символы. Обычно это a-z, 0-9 и "_" или "-". То есть, только прописные буквы латинского алфавита и цифры (как пример). Допустим, нам нужно название статьи в блоге преобразовать в slug для добавления его в URL этой статьи. Как это лучше всего сделать? В Django по умолчанию есть готовая функция slugify для таких случаев. Но я её никогда не использую. Почему? Потому что её недостаточно! Приведём пример >>> from django.utils.text import slugify >>> slugify('This is a Title') 'this-is-a-title' Пока всё отлично >>> slugify('This is a "Title!"') 'this-is-a-title' Спец символы удалились, всё хорошо. >>> slugify('Это заголовок статьи') '' Вот и приехали 😢. Если текст не английский то буквы просто игнорируются. Можно это поправить >>> slugify('Это заголовок статьи', allow_unicode=True) 'это-заголовок-статьи' Но тогда мы не вписываемся в условие. У нас появилась кириллица в тексте. Так как я часто пишу сайты для русскоязычных пользователей эта проблема весьма актуальна. Я не использую стандартную функцию и всегда пишу свою. Оригинал я не беру в расчёт и пишу полностью свою функцию. И так, по порядку: 🔸1. Исходный текст: >>> text = 'Мой заголовок №10 😁!' Взял специально посложней со специальными символами. 🔸2. Транслит Необходимо сделать транслит всех символов в латиницу. Здесь очень выручает библиотека unidecode. Помимо простого транслита кириллицы в латиницу она умеет преобразовывать спец символы и иероглифы в текстовые аналоги. from unidecode import unidecode >>> unidecode("Ñ Σ ® µ ¶ ¼ 月 山") 'N S (r) u P 1/4 Yue Shan' Очень крутая библиотека, советую👍 В нашем случае получаем такое преобразование: >>> text = unidecode(text) >>> print(text) 'Moi zagolovok No. 10 !' Отличный транслит. Смайл просто удалился, хотя я ждал что-то вроде :). Ну и ладно, всë равно невалидные символы. А еще наш код уже поддерживает любой язык, будь то хинди или корейский. 🔸4. Фильтр символов Unidecode не занимается фильтрацией по недопустимым символам. Это мы делаем в следующем шаге через regex. Просто заменим все символы на "_" если они вне указанного диапазона. >>> text = re.sub(r'[^a-zA-Z0-9]+', '_', text) >>> print(text) 'Moi_zagolovok_No_10_' Символ "+" в паттерне выручает когда несколько недопустимых символов идут рядом. Все они заменяются на один символ "_". 🔸5. Slugify Осталось удалить лишние символы по краям и сделать нижний регистр >>> text = text.strip('_').lower() >>> print(text) 'moi_zagolovok_no_10' Получаем отличный slug! 😎 🌎 Полный код в виде функции. ______________ PS. Проверку что в строке остался хоть один допустимый символ я бы вынес в отдельную функцию. #libs#tricks#django
Пребарај: #amphibians
@googlefactss · Post #40017 · 05.11.2025 г., 08:17
One of the main differences between frogs and toads is that frogs need to stay by water to survive, whereas toads can survive without constant access to moisture. @googlefactss#amphibians
Hashtags
@googlefactss · Post #39987 · 31.10.2025 г., 14:11
The wood frog can hold its pee for up to eight months by recycling urea into nitrogen, a process that helps protect their cells and tissues while they hibernate and freeze solid during the winter. @googlefactss#amphibians
Hashtags
@googlefactss · Post #39964 · 28.10.2025 г., 16:05
The world’s largest frog, the Goliath frog, is found in Equatorial Guinea and Cameroon. It is capable of growing up to 34 cm (13.4 inches) in length and can weigh over 3.2 kg (7 pounds). @googlefactss#amphibians#nowyouknow
Hashtags
@interesting_planet_facts · Post #811 · 25.09.2025 г., 12:11
🌎 The male pipa toad, found in South American rivers, carries dozens of eggs in pockets on its back skin. As the eggs develop, young toads emerge fully formed through openings in his skin. Each pocket can hold up to 100 eggs, making this reproduction method unique among amphibians. ✨ #animals⚡#amphibians⚡#wildlife 👉subscribe Interesting Planet 👉more Channels
Hashtags
@amazingeo · Post #628 · 12.02.2026 г., 20:31
🌍 The Western Ghats in India hold more amphibian species than all of Europe, packed into a narrow mountain strip. This biodiversity hotspot shelters ancient frogs found nowhere else on Earth. ✨ #biodiversity⚡#hotspots⚡#amphibians⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels
@googlefactss · Post #40071 · 12.11.2025 г., 06:23
Some frog species, such as the Senegal running frog and the red-banded rubber frog, move across land by walking or crawling rather than hopping. @googlefactss#amphibians#frogs
Hashtags
@amazingeo · Post #705 · 01.05.2026 г., 20:31
🌍 Some tropical frogs breed in water-filled leaves high in the rainforest canopy. Their tadpoles grow safely above ground, rarely touching the forest floor their entire lives. ✨ #rainforest⚡#amphibians⚡#canopy⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels
@interesting_planet_facts · Post #505 · 05.08.2025 г., 18:22
🌎 The glass frog of Central and South America has translucent skin on its belly, making its heart and organs visible—a true living “window” into biology! This see-through feature offers researchers a unique view of amphibian anatomy without special equipment. ✨ #amphibians⚡#rainforest⚡#transparency 👉subscribe Interesting Planet
@interesting_planet_facts · Post #499 · 04.08.2025 г., 18:22
🌎 The rainbow mantella frog of Madagascar sports neon green and orange skin, warning predators of its toxicity. These tiny amphibians gain their deadly defenses from eating certain ants and mites in the wild. ✨ #amphibians⚡#Madagascar⚡#toxins 👉subscribe Interesting Planet
Hashtags
@interesting_planet_facts · Post #1267 · 01.02.2026 г., 22:11
🌎 The axolotl, a salamander native to Mexico, can regenerate entire limbs, spinal cord, heart tissue, and even parts of its brain. Unlike most amphibians, axolotls remain aquatic and gilled for their whole lives due to a trait called neoteny. ✨ #axolotl⚡#regeneration⚡#amphibians 👉subscribe Interesting Planet 👉more Channels
Hashtags
@googlefactss · Post #40930 · 14.04.2026 г., 22:01
The Titicaca water frog (Telmatobius culeus) can absorb oxygen through its skin, an adaptation that helps it survive in the high-altitude waters of Lake Titicaca, where oxygen levels are low. This unique ability allows it to thrive in an environment where most other species struggle. The frog's skin is highly vascularized, increasing its efficiency at absorbing oxygen directly from the water. 💧🐸⛰️ [Read more] (Frog memes allowed here) @googlefactss #FrogFacts#TiticacaFrog#TelmatobiusCuleus#NatureScience#UniqueAdaptations#Amphibians#ItsWednesdayMyDudes If you have ideas or feedback contact us: @Googlefactss_Feedback_bot
@googlefactss · Post #40864 · 27.03.2026 г., 07:01
Axolotls, also known as Ambystoma mexicanum, get their name from the Aztec language Nahuatl, meaning "water monster" or "water god." According to legend, they are the earthly form of Xolotl, the Aztec god who transformed into a salamander to avoid sacrifice. These creatures are famous for regenerating limbs, hearts, and even parts of their brains. They stay in their juvenile form for life, a trait called neoteny. In the wild, axolotls are critically endangered, with fewer than 1,000 left in Mexico’s Xochimilco and Chalco lakes. Habitat loss, pollution, and invasive species like tilapia are major threats. Conservation efforts are underway to restore their habitat and protect them from extinction. 🦎🌍💧 [Read more] If you have one as a pet, feel free to share with us! @googlefactss #Axolotl#WaterGod#EndangeredSpecies#Regeneration#Neoteny#Conservation#Wildlife#Mexico#Amphibians