TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #239 · 3 мај

Один из самых удобных способов записать данные это использование готовых форматов, такие как JSON или YAML. Из плюсов такого подхода стоит отметить вот что: 🔸 готовый, повсеместно используемый и поддерживаемый формат 🔸 простой и понятный файл, удобочитаемый для человека 🔸 можно легко редактировать в любом текстовом редакторе без специальных программ и библиотек Но есть и минусы 🔹 затраты времени при записи файла (кодирование данных в нужный формат строки) 🔹 затраты времени при чтении файла (декодирование данных в Python объекты) 🔹 размер файла увеличивается из-за разметки данных (скобки, запятые, переносы, отступы...) 🔹 перед записью все данные должны быть помещены в память в полном объёме (не всегда) 🔹 при чтении необходимо считать весь файл в память и только потом декодировать данные Если нужно писать немного данных в несколько файлов, то затраты по времени не ощутимы. Обычно это файлы конфига или какие-либо метаданные. Это отличный вариант под такие задачи. Есть и другой поход к записи файлов - это бинарные файлы. Используется, когда данных достаточно много и никто их не собирается читать глазками😳. 🔸 очень быстрая запись 🔸 чтение значительно быстрей чем JSON, YAML итд 🔸 размер файла значительно меньше, так как нет разметки 🔸 можно записывать данные по мере поступления не загружая всё в память 🔸 можно извлечь любую часть данных независимо Из минусов 🔹 нужно определить свой формат записи данных (если не используете готовую спецификацию определённого формата) 🔹 не получится открыть файл и визуально понять что там записано, а для чтения файла потребуется знать его спецификацию. 🔹 не так-то просто создать такой файл без специальной библиотеки В таком виде удобно записывать большой массив любых однородных данных. Например, мониторинг валютной биржи или кэшированная анимация 3D геометрии. (Это не означает что нельзя записать данные разного типа, просто это будет не так удобно) Представьте себе JPG-картинку. По сути это немного мета-информации и большой массив пикселей. Тоже самое со звуком или видео файлом. Поэтому, если вы попробуете открыть картинку в текстовом редакторе вы увидите что-то вроде такого f15d cd29 a564 4578 ... 09e2 9bc4 a696 1253 ... 84e9 4de1 3b23 c24a ... 2534 5161 28e0 709d ... ... Это и есть записанные байтики. И для их чтения требуется определённый софт который знает что с ними делать. Под каждый тип файла. К чему это я? Читайте в следующем посте... #tricks#basic

Резултати

Пронајдени 204 слични објави

Пребарај: #germany

当前筛选 #germany清除筛选
EKOLOG.UZ| ENG

@ekologuzenglish · Post #11899 · 13.03.2026 г., 10:02

#Germany 🦇 A €200 million railway section in Germany is stalled because of bats In Baden-Württemberg, residents of the Calw district are waiting for train traffic to resume on a railway section and tunnel whose repair took decades and cost over €200 million. But there is one insurmountable obstacle — more than 1,000 bats living in the tunnel between Calw and Weil der Stadt stations. These animals are under strict protection, so they cannot be removed. An unusual solution was found — to build a protective concrete wall inside the tunnel. On one side, trains will run; on the other, the bats can sleep undisturbed. This will require 300 concrete blocks and about €80 million. Additionally, ultrasonic sensors will be installed to help the bats navigate their new shelter. However, it is still unknown how quickly they will adapt to the new structure, and this will determine when the tunnel can reopen. ⚠️ This is not an isolated case: in Kiel, 900 bats prevented the demolition of an old swimming pool because the animals refused to move to new shelters. 🦇 Sometimes even very small creatures can have a big impact on massive infrastructure projects! ☘️Read the latest environmental news on the @ekologuz page. Follow us and send your suggestions and wishes via @eklguz_bot Instagram | Facebook | Twitter | Sayt | Youtube.

Hashtags

POPULAR FRONT

@popularxfront · Post #5751 · 04.04.2026 г., 19:33

🇩🇪#Germany: Men in Germany aged 17 to 45 are required to obtain approval from the Bundeswehr (German armed forces) career center before leaving the country for more than three months, whether for study, work, or travel. The provision was included in a broader military reform package approved in December, but went largely unnoticed until it was reported by the German outlet Frankfurter Rundschau. The measure received little public attention at the time and was not widely discussed. Despite the law being in place, it remains unclear how this requirement will be implemented in practice, particularly for individuals who were unaware of it or who have already left the country.

Hashtags

"We cannot remain silent. No-one can remain silent when there is an ongoing genocide and when people are denied the most basic human needs ... To stand with Palestine is to be human." Greta Thunberg calls out Israel's genocide during a speech in Leipzig, #Germany. https://t.me/YediotNewsChat

Hashtags

International Geographic

@internationalgeographic · Post #5479 · 07.03.2025 г., 23:30

Heidelberg, #Germany🇩🇪 Heidelberg was not affected by the bombing of the Second World War, so it was preserved in its original medieval form - a castle, numerous churches and abbey, ancient streets.

Hashtags

International Geographic

@internationalgeographic · Post #5477 · 07.03.2025 г., 04:22

Nuremberg, #Germany🇩🇪 Every year in Nuremberg, the largest Christmas fair is held throughout Europe. Nuremberg is the city of inventors. It was he who gave the world things such as pocket watches, a globe, a compass, a pelting and a current machine.

Hashtags

POPULAR FRONT

@popularxfront · Post #4567 · 17.01.2026 г., 21:32

🇩🇪#Germany: A knife attack took place during an anti-Iranian regime protest in Hamburg. A man went on a stabbing spree targeting protesters, reportedly deliberately targeting anti-regime demonstrators. He managed to stab two protesters. One victim is in serious condition in hospital, while the second received medical aid at the scene after being stabbed in the leg. (via @froopashee2)

Hashtags

Aesthetica

@Aetatesolis · Post #4536 · 11.09.2025 г., 15:16

German Cities in 1937 Rare Pre-war Footage Colorized and Restored With Added Ambient Sound. #germany AETATESOLIS

Hashtags

POPULAR FRONT

@popularxfront · Post #4208 · 19.12.2025 г., 15:56

Repost via @ben_ditto on IG 🇩🇪#Germany: Cockroach swarm agents 🪳 Swarm Biotactics, a deep tech start-up based in Kassel, Germany, specialising in “bio-robotics”: putting miniature sensor backpacks on cockroaches and then sending these as swarms into environments inaccessible for conventional robots, drones, or humans such as collapsed structures following natural disasters, GPS-denied areas, or contested warfare zones. The swarm of roaches act as real-time data agents 🪳 The company has received €13 million in funding so far from a consortium of international investors, including Vertex Ventures US, Possible Ventures, and Capnamic 🪳 Footage of cockroaches taken from 60 Minutes on CBS.

Hashtags

Voyage.Travel.Tourism

@VOYAGE · Post #1524 · 08.08.2025 г., 12:14

❄️ A breathtaking winter at Lake Eibsee! 🏔️ 🟠Snowy peaks, crystal-clear water, and a magical winter wonderland. Simply stunning! 📏 📏 📏 📏 📏 📏 📏 📏 #Germany | @voyage

Hashtags

Voyage.Travel.Tourism

@VOYAGE · Post #1513 · 28.07.2025 г., 12:14

Germany🇩🇪 ⭐️Halberstadt Cathedral — a majestic legacy of German Gothic architecture. 📏 📏 📏 📏 📏 📏 📏 📏 #Germany | @voyage

Hashtags

123•••10•••1617
ПретходнаСтраница 1 од 17Следна