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

Резултати

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

Пребарај: #climatechanges

当前筛选 #climatechanges清除筛选
Trump's Ear

@trumpsear_tg · Post #1802 · 20.11.2025 г., 14:59

The White House's climate policy may lead to 1.3 million deaths 🚨🔥, an analysis by ProPublica and the Guardian shows that Donald Trump's decisions, which return the country's oil, gas and coal production to previous volumes and lift climate restrictions, will increase emissions and lead to 1.3 million additional deaths from heat in the future 😱⛏️, writes the Guardian. The poor and hot countries of Africa and South Asia will bear the brunt. 🌍🔥 Scientists are already seeing an increase in mortality. In the United States, the number of deaths due to heat has increased by more than 50% since 2000. ☀️📈 In India and Pakistan, heat above 48 degrees is already causing deaths in towns and villages. 🔥🏞 The elderly, children, and those who work on the streets suffer more than others. 👵👶🏃‍♂️ The authors of the analysis believe that the increase in emissions in the next ten years will worsen the situation. 🗣💨 Researchers say that the United States accounts for a fifth of the world's emissions, but it will see only a small increase in deaths. 🇺🇸🌍 The regions where people already live in extreme heat will suffer the most. #Trump#ClimateChanges 👂More on Trump's Ear

Trump's Ear

@trumpsear_tg · Post #2303 · 25.03.2026 г., 20:05

The Trump administration announced it will pay nearly $1 billion to French energy giant TotalEnergies in exchange for the company abandoning plans to build offshore wind farms in the Atlantic Ocean and instead pursue fossil fuel projects in the US. ⚡️ The current administration has thrown up roadblocks at every turn for offshore wind projects; a type of energy that President Donald Trump has personally reviled for years. After trying and failing to block construction on more mature projects, this announcement is the first sign of a new strategy: The federal government is paying to stop wind farms before they begin. 🌬 Last year, the Trump Interior Department took the step of stopping the approval of federal permits for renewable energy projects, a move that effectively killed offshore wind projects in early development. Monday’s deal builds on that, by trying to ensure companies can’t continue building under a future administration friendlier to offshore wind. 🏛 The government is paying back TotalEnergies for federal leases it purchased under the Biden administration to develop two offshore wind farms off the coasts of New York and North Carolina. The Justice Department will use nearly $1 billion in taxpayer funds to reimburse the company for money it spent to purchase leases under the Biden administration. 💰 Together, those two projects could have generated more than 4 gigawatts of electricity for US households and businesses, according to developers. ⚡️ #Energy#ClimateChanges 👂More on Trump's Ear ⚠️

Trump's Ear

@trumpsear_tg · Post #2147 · 13.02.2026 г., 14:59

Trump canceled a key point of the US climate policy, calling greenhouse gases harmless. US President Donald Trump has achieved the cancellation of the decision on which the American climate policy has been based since 2009. The U.S. Environmental Protection Agency (EPA) has invalidated the Obama-era conclusion that carbon dioxide and other greenhouse gases pose a threat to public health and well-being. It was on this norm that the key climate restrictions under the Clean Air Act were based, from emission limits for cars to requirements for power plants and industry. Trump and EPA chief Lee Zeldin called the move "the largest deregulation in American history." According to Trump, the previous rules were "disastrous," hurting the auto industry and "inflating prices for consumers." Environmentalists call the cancellation a historic setback and the biggest blow to the United States' ability to combat climate change. #Trump#Ecology#ClimateChanges 👂More on Trump's Ear ⚠️