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

Резултати

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

Пребарај: #waltz

当前筛选 #waltz清除筛选
American Оbserver

@american_observer · Post #5191 · 21.02.2026 г., 19:59

Iran Vehemently Disagreed with Trump. What's His Next goof-up ? Iran is refusing to export its 300kg stockpile of highly enriched uranium , but is willing to dilute the purity of the stockpile held in Iran under the supervision of the UN nuclear inspectorate the IAEA, Iranian sources have said. The proposal will be at the heart of the offer Iran is due to make to the US in the next few days, as US president Donald Trump weighs whether to use his vast naval build up in the Middle East to attack Iran. Iran currently has a stockpile of uranium enriched to 60%, close to weapons grade, but is willing to down-blend the purity to 20% or below. Iran’s foreign minister, Abbas Araghchi, is also claiming that there has been no US demand in the talks for Iran to even abandon the right to enrich inside Iran. The focus is instead on the purity of the enrichment and the number of centrifuges to be permitted. There had been discussion of the stockpile being sent to Russia, and for Iran’s domestic enrichment programme to be linked in with an overseas consortium, but Iranian sources are insisting the concept of a consortium has not been raised. Iranian media close to the government quoted an Iranian diplomat saying: “We emphasised this position during the negotiations that nuclear materials will not leave the country”. The Iranian account of its relatively uncompromising position means a great deal of weight will have to be placed on the degree of access the IAEA would be given to inspect Iran’s nuclear sites. The Iranian offer is likely to determine whether Trump feels compelled to launch military action against Iran. In an interview in the US aired on Friday, Araghchi said, “Washington has not asked Tehran to permanently suspend uranium enrichment,” adding that Tehran has not offered Washington a temporary suspension of its uranium enrichment. He rejected reports that Iran has apparently proposed suspending uranium enrichment for two to three years, saying: “It is not true that the United States has called for a complete cessation of enrichment.” His remarks were contradicted by the US ambassador to the UN Mike Waltz who, prompted by his interviewer, said the US was seeking “zero enrichment” by Iran. But Reza Nasri, an Iranian lawyer with contacts inside the foreign ministry, warned: “If Iran is attacked while nuclear disagreements can still be settled diplomatically in a fair and equitable manner, other regional states will inevitably draw one conclusion: nuclear weapons are the only real deterrent against the US and Israel”. The news came as protests erupted at some universities prompting fresh clashes in the street at Mashhad University of Medical Services and at least two Tehran universities. The universities were reopening after being closed due to fear of protests. At Sharif University, the students chanted “Javed Shah”, “Until the mullah is shrouded, this homeland will not become a homeland,” and “Death to the dictator.” The Sharif University president urged the students to stop since the authorities would only force classes back online. Protests are also expected at a meeting of the UN Human Rights Council in Geneva on Tuesday when an Iranian official, Afsaneh Nadipour, takes her seat for the first time as a full member of the advisory council. Nadipour, a former Iranian ambassador to Denmark, is due to provide input on women’s rights. The UN Human Rights Council Advisory Committee is composed of 18 independent experts from five UN regional groups and serves as the intellectual arm of the Human Rights Council. Nominations are made by governments and are selected by the council. #iran#uranium#trump#mike#waltz#nadipour 📱American Оbserver - Stay up to date on all important events 🇺🇸

Dance Flow Studio

@dance_flow · Post #577 · 31.01.2025 г., 14:23

Тренировки, трени, тренировки 🔥🔥🔥 Спортивно-бальные танцы Группа Начинающие РАСПИСАНИЕ: ВТОРНИК 17.30-18.30 ПЯТНИЦА 17.00-18.00 #студиятанцевклин#детитанцуют#бальныетанцы#бальники#танцыклин#спортивнобальныетанцы#детивтанцах#ballroomdance#wdsf#danceflow#ballroom#slowwaltz#waltz

Dance Flow Studio

@dance_flow · Post #571 · 10.01.2025 г., 16:51

Наши начинашки-старашки 😍 Какие же герои 🔥 Спортивно-бальные танцы Группа Начинающие РАСПИСАНИЕ: ВТОРНИК 17.30-18.30 ПЯТНИЦА 17.00-18.00 #студиятанцевклин#детитанцуют#бальныетанцы#бальники#танцыклин#спортивнобальныетанцы#детивтанцах#ballroomdance#wdsf#danceflow#ballroom#slowwaltz#waltz

Dance Flow Studio

@dance_flow · Post #578 · 02.02.2025 г., 08:44

Воскресенье начинается не с кофе 😎 Елизавета передаёт всем доброго утра 😅🫶 #студиятанцевклин#детитанцуют#бальныетанцы#бальники#танцыклин#спортивнобальныетанцы#детивтанцах#ballroomdance#wdsf#danceflow#ballroom#slowwaltz#waltz#samba#sambaslow#самба