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

Резултати

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

Пребарај: #chinaus

当前筛选 #chinaus清除筛选
世界新闻 World News 📮

@media_rss · Post #4452101 · 15.05.2026 г., 07:29

Watch: Global business voices on China-US trade relations China-US relations are in the spotlight as global business watches US President Donald Trump's visit to China and what it means for trade, investment and market confidence. In this episode of BizTalk, CGTN's Lincoln Humphries sits down with Fred Teng, president of the AmericaChina Public Affairs Institute, Chris Torrens, chairman of the British Chamber of Commerce in China, and Oliver Oehms, executive director and board member of the German Chamber of Commerce in China – North China; exploring investment sentiment, business trends and why China-US cooperation still matters in an uncertain global economy. #ChinaUS via CGTN

Hashtags

世界新闻 World News 📮

@media_rss · Post #4452011 · 14.05.2026 г., 07:10

Live: Beyond the buzz – What do young Americans really think about China-US relations? What happens when young Americans experience China beyond the headlines? Join CGTN for a candid conversation with US creators and students living in China as they share firsthand perspectives on daily life, consumer trends, innovation and how these experiences are reshaping their understanding of China's economic dynamism and China-US connections. #ChinaUS via CGTN

Hashtags

Russian Consulate in Cape Town

@rusconct · Post #2168 · 18.01.2025 г., 18:31

📰 Presidential Aide Nikolay Patrushev gave an interview to Komsomolskaya Pravda newspaper(January 14, 2025) Key points: #USA • The US establishment has been divided and lacks a common policy vision for the world and domestically. • Trump’s core message is that he supposedly has a plan to revive pragmatic politics in the United States, which is expected to benefit both the state and its people. It has yet to be seen how this compares with the interests of other countries and nations. • If Trump’s first term as president is any guide, the infamous deep state has a lot of clout in the USA. It can prevent Trump from pursuing his agenda. • Trump will not view Ukraine as a priority. China is a much bigger concern for him. • Trump has outlined his interests regarding Greenland, the Panama Canal, Mexico and Canada. There is an American tradition that consists of reshaping the world map to suit the US interests and interfering in the affairs of other countries across various continents. • It seems unlikely that Trump sends the army to invade new states for the United States, as some have been saying. What is clear, however, is that the new administration will be proactive in asserting its interests in its dealings with all these countries. #ChinaUS • I believe that disagreements between Washington and Beijing will escalate, and it will be the United States that will intentionally fan these flames. #RussiaChina • For Russia, China has been and will remain a key partner as part of our privileged strategic cooperation. These relations are immune to momentary consideration and will endure regardless of who gets into the Oval Office. #Ukraine • Talks on Ukraine must take place between Russia and the United States without any other Western countries. • The people of Ukraine remain a kindred, brotherly nation with our ties reaching back centuries, no matter what the Kiev propaganda mouthpieces say in their Ukrainisation frenzy. We do care about what is happening in Ukraine. #Moldova • Chisinau must be honest with itself and stop deceiving its people. The Moldovan authorities must recognise their mistakes and get down to mending fences instead of searching for enemies inside the country and in Transnistria. #Europe • We have nothing to discuss with either London or Brussels. For example, EU leadership has long lost the right to speak on behalf of many members including Hungary, Slovakia, Austria, Romania and several other countries which are interested in ensuring stability in Europe and have adopted a balanced position towards Russia. Read in full

IELTS|Newspapers & Magazines|English

@emagzinewspars · Post #9342 · 15.10.2025 г., 02:02

#Beijing_Review🇨🇳📕[PDF]⬇️ 2 #October2025 #Weekly_Magazines For learning, for free(dom). @backupofmagazines In this issue , the spotlight shines on #Xinjiang 70, celebrating seven decades of transformation in the autonomous region—from economic health to cultural heritage. Global topics include #PalestineRecognition, evolving #ChinaUS relations, and the healing potential of dialogue via the #XiangshanForum. Special features explore #RuralRevitalization and tech-driven change in Qingdao and Fujian, as #ScienceInnovation takes center stage. From the vibrant Grand Bazaar to a Somali expat’s vision, this issue captures both regional pride and global dialogue. #BeijingReview#CulturalDiversity#BeltAndRoad#EducationMatters#ChinaPerspective