@googlefactss · Post #40012 · 04.11.2025 г., 14:03
Rediscovery, after presumed extinction, makes a species a "Lazarus species". @googlefactss #funfact#extinction#LazarusSpecies
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #241 · 5 мај
Можно ли в Python создавать бинарные файлы? Конечно можно. Для этого в Python есть следующие инструменты: ▫️ тип данных bytes и bytearray ▫️ открытие файла в режиме wb (write binary) или rb (read binary) ▫️ модуль struct Про модуль struct поговорим в первую очередь. Файл в формате JSON или Yaml внутри себя содержит разметку данных. Всегда можно определить где список начался а где закончился. Где записана строка а где словарь. То есть формат записи данных содержит в себе элементы разметки данных. В binary-файле данные не имеют визуальной разметки. Это просто байты, записанные один за другим. Правила записи и чтения находятся вне файла. Модуль struct как раз и помогает с организацией данных в таком файле с помощью определения форматов записи для разных частей файла. Модуль struct преобразует Python-объекты в массив байт, готовый к записи в файл и имеющий определённый вид. Для этого всегда следует указывать формат преобразования (или, как оно здесь называется - запаковки). Формат нужен для того, чтобы выделить достаточное количество байт для записи конкретного типа объекта. В последствии с помощью того же формата будет производиться чтение. При этом следует помнить что мы говорим о типах языка С а не Python. Именно формат определяет, что записано в конкретном месте файла, число, строка или что-то еще. Вот какие токены формата у нас есть. Помимо этого, первым символом можно указать порядок байтов. На разных системах одни и те же типы данных могут записываться по-разному, поэтому желательно указать конкретный способ из доступных. Если этого не сделать, то используется символ '@', то есть нативный для текущей системы. В строке формата мы пишем в каком порядке и какие типы собираемся преобразовать в байты. Запакуем в байты простое число, токен "i". >>> import struct >>> struct.pack('=i', 10) b'\n\x00\x00\x00' Теперь несколько float, при этом нужно передавать элементы не массивом а последовательностью аргументов. >>> struct.pack('=fff', 1.0, 2.5, 4.1) b'\x00\x00\x80?\x00\x00 @33\x83@' Вместо нескольких токенов можно просто указать нужное количество элементов перед одним токеном, результат будет тот же. >>> struct.pack('=3f', 1.0, 2.5, 4.1) b'\x00\x00\x80?\x00\x00 @33\x83@' Теперь запакуем разные типы >>> data = struct.pack('=fiQ', 1.0, 4, 100500) я запаковал типы float, int и unsigned long long (очень большой int, на 8 байт) b'\x00\x00\x80?\x04\x00\x00...' Распаковка происходит аналогично, но нужно указать тот же формат, который использовался при запаковке. Результат возвращается всегда в виде кортежа. >>> struct.unpack('=fiQ', data) (1.0, 4, 100500) Как видите, ничего страшного! #lib#basic
Пребарај: #extinction
@googlefactss · Post #40012 · 04.11.2025 г., 14:03
Rediscovery, after presumed extinction, makes a species a "Lazarus species". @googlefactss #funfact#extinction#LazarusSpecies
@amazingeo · Post #461 · 18.11.2025 г., 12:31
🌍 Since 1970, vertebrate wildlife populations have dropped by an average of nearly 70% worldwide. Habitat loss and pollution are major drivers of this rapid, ongoing global decline. ✨ #environment⚡#extinction⚡#biodiversity⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels
@interesting_planet_facts · Post #1381 · 22.04.2026 г., 12:11
🌎 Layers of ancient mud and sand, called sedimentary strata, hold natural records of Earth’s history. These layers show changes in climate, ocean levels, and even mass extinction events over millions of years. The famous K-T boundary, found in rock layers worldwide, marks the asteroid impact that ended the age of dinosaurs about 66 million years ago. ✨ #geology⚡#fossils⚡#extinction 👉subscribe Interesting Planet 👉more Channels
Hashtags
@amazingeo · Post #267 · 19.09.2025 г., 20:12
🌍 Nearly 90% of the world’s wetlands have disappeared since 1700, shrinking vital habitats and reducing natural flood protection for millions of people living downstream. ✨ #wetlands⚡#extinction⚡#flooding⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍
@interesting_planet_facts · Post #779 · 19.09.2025 г., 03:22
🌎 The Steller’s sea cow, a giant marine mammal, was discovered in the Bering Sea in 1741 and went extinct just 27 years later due to overhunting. This species reached lengths up to 9 meters and fed on kelp, leaving no close living relatives today. ✨ #extinction⚡#megafauna⚡#ocean 👉subscribe Interesting Planet
Hashtags
@interesting_planet_facts · Post #1229 · 16.01.2026 г., 22:11
🌎 Around 252 million years ago, the Permian-Triassic extinction wiped out about 90% of marine species and 70% of land vertebrates. Massive volcanic eruptions in Siberia released greenhouse gases that drove rapid global warming, ocean acidification, and low oxygen levels—making it the largest extinction event in Earth's history. ✨ #extinction⚡#volcanoes⚡#paleoclimate 👉subscribe Interesting Planet 👉more Channels
@interesting_planet_facts · Post #438 · 27.07.2025 г., 16:22
🌎 The Gomphothere, an ancient cousin of elephants, once roamed the Americas with shovel-shaped lower jaws. These extinct giants sported four tusks instead of two, thriving for millions of years before vanishing at the end of the last Ice Age. ✨ #paleontology⚡#megafauna⚡#extinction 👉subscribe Interesting Planet
@interesting_planet_facts · Post #1346 · 19.03.2026 г., 12:11
🌎 Strange bones found on the island of Malta belong to dwarf elephants and hippos that once lived there. These animals evolved smaller sizes due to limited island resources. The dwarf elephant species Palaeoloxodon falconeri stood just one meter tall at the shoulder. ✨ #extinction⚡#paleontology⚡#Mediterranean 👉subscribe Interesting Planet 👉more Channels
@interesting_planet_facts · Post #1209 · 10.01.2026 г., 12:11
🌎 The moa, a group of flightless birds native to New Zealand, stood up to 3.6 meters tall and weighed over 200 kilograms. DNA analysis reveals that moas’ closest relatives are the small, flying South American tinamous, not ostriches or emus as once believed. ✨ #moa⚡#extinction⚡#paleontology 👉subscribe Interesting Planet 👉more Channels
Hashtags
@interesting_planet_facts · Post #843 · 01.10.2025 г., 18:11
🌎 The giant moa, once native to New Zealand, stood up to 3.6 meters tall and weighed about 230 kilograms. Moa vanished around 600 years ago, likely due to hunting by early Polynesian settlers. DNA studies show there were at least nine distinct moa species before extinction. ✨ #moa⚡#extinction⚡#paleontology 👉subscribe Interesting Planet 👉more Channels
Hashtags
@interesting_planet_facts · Post #743 · 13.09.2025 г., 20:22
🌎 The dodo bird, once native to Mauritius, vanished by the late 17th century. Little was documented about its appearance or habits, leaving scientists puzzled. Recent studies of preserved bones and rare historical notes suggest the dodo was likely grayish with small wings and weighed up to 18 kilograms. ✨ #dodo⚡#extinction⚡#mysteries 👉subscribe Interesting Planet
Hashtags
@interesting_planet_facts · Post #1269 · 02.02.2026 г., 22:11
🌎 In Siberia, the woolly mammoth roamed the tundra until about 4,000 years ago. Some frozen mammoth carcasses still contain preserved hair, skin, and even stomach contents. Recent DNA studies show mammoths were closely related to modern Asian elephants. ✨ #mammoth⚡#extinction⚡#Siberia 👉subscribe Interesting Planet 👉more Channels
Hashtags