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

Резултати

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

Пребарај: #usiranrelations

当前筛选 #usiranrelations清除筛选
Crypto M - Crypto News

@CryptoM · Post #65258 · 12.04.2026 г., 11:33

🚀 Iranian Officials Predict Changes in Strait of Hormuz Dynamics Iranian negotiation team member Nabawian stated on the 12th that the Strait of Hormuz is expected to undergo significant changes. According to NS3.AI, Ali Nikzad, Deputy Speaker of the Iranian Islamic Parliament, emphasized that the United States should understand that diplomacy requires respect, interaction, and acceptance of reality. #Iran#StraitOfHormuz#Diplomacy#USIranRelations#MiddleEastPolitics

Crypto M - Crypto News

@CryptoM · Post #65209 · 12.04.2026 г., 02:07

🚀 Bitcoin Drops 2% Amid U.S.-Iran Negotiation Stalemate Bitcoin experienced a decline of approximately 2%, settling around $71,600 following a statement by Vice President J.D. Vance. According to NS3.AI, the announcement revealed that U.S. and Iranian negotiators were unable to reach an agreement on extending a ceasefire. This development occurred after a nearly six-week U.S. campaign against Iran, with talks taking place in Pakistan. In the wake of Vance's press conference, Ethereum (ETH) also saw a decrease, falling to about $2,200. XRP dropped to $1.33, and the CoinDesk 20 index fell to 1,188.52. The market's reaction highlights the sensitivity of cryptocurrency prices to geopolitical events and negotiations. #Bitcoin#Ethereum#XRP#Cryptocurrency#USIranRelations#Geopolitics#MarketUpdate#CryptoNews#BTC#ETH

Crypto M - Crypto News

@CryptoM · Post #64694 · 09.04.2026 г., 14:31

🚀 U.S. President Trump May Impose New Iran-Related Duties U.S. President Donald Trump has the authority to impose new duties related to Iran under an emergency law, according to his top economic adviser. Bloomberg posted on X that this development follows a previous Supreme Court ruling that the law could not be used to impose tariffs. The potential move could have significant implications for U.S.-Iran relations and international trade dynamics. #US#Trump#Iran#Tariffs#InternationalTrade#USIranRelations#Economy

Crypto M - Crypto News

@CryptoM · Post #65239 · 12.04.2026 г., 07:53

🚀 Iran Asserts Control Over Strait of Hormuz, Demands Transit Fees in Rials Iran's deputy speaker of the Islamic Consultative Assembly, Haji Babaei, has issued a warning to the United States regarding the strategic Strait of Hormuz, declaring it a 'red line' under Iran's full control. According to NS3.AI, Babaei emphasized that transit fees through the strait must be paid in Iranian rials. Mehr News Agency reported that the majority of Iranian parliament members back the plan concerning the Strait of Hormuz, highlighting its significance in regional geopolitics. #Iran#StraitOfHormuz#Geopolitics#TransitFees#MiddleEast#IranianParliament#USIranRelations

Crypto M - Crypto News

@CryptoM · Post #64843 · 10.04.2026 г., 03:34

🚀 Iranian Officials Remain in Tehran Amid Regional Tensions Iranian Foreign Minister Araghchi and Speaker Qalibaf have not left Iran, according to Odaily. Both officials are currently in Tehran, actively fulfilling their national duties amid evolving regional circumstances. A source stated that reports of an Iranian negotiation team arriving in Islamabad for talks with the U.S. are entirely false. The source emphasized that negotiations will remain stalled as long as the U.S. does not fulfill its ceasefire commitments in Lebanon and the Zionist regime continues its attacks. Previously, The Wall Street Journal claimed that an Iranian delegation arrived in Islamabad on Thursday night. #Iran#Tehran#RegionalTensions#Diplomacy#MiddleEast#USIranRelations#Lebanon#ZionistRegime

Crypto M - Crypto News

@CryptoM · Post #65300 · 12.04.2026 г., 16:22

🚀 John Bolton Advocates for Blockade Following Failed Iran Peace Talks Former U.S. National Security Advisor John Bolton has suggested that a blockade could be a sensible approach after peace negotiations with Iran did not succeed. Bloomberg posted on X, highlighting Bolton's comments made during a discussion with journalists Eena Ruffini and Tim Steno. Bolton's remarks come amid ongoing tensions between the U.S. and Iran, following unsuccessful diplomatic efforts to resolve disputes. The former advisor's stance reflects a more aggressive strategy in dealing with Iran, as diplomatic channels have yet to yield positive results. #JohnBolton#Iran#USIranRelations#Blockade#Diplomacy#PeaceTalks#InternationalRelations#MiddleEast#USPolitics#ForeignPolicy

Crypto M - Crypto News

@CryptoM · Post #65062 · 10.04.2026 г., 17:45

🚀 Iran's Leadership Revamp Amid Peace Talks with the US The ongoing conflict in Iran has prompted significant changes in the nation's leadership structure. Bloomberg posted on X that the Revolutionary Guards are set to play a pivotal role in the upcoming peace negotiations with the United States this weekend. This shift in power dynamics underscores the growing influence of the Revolutionary Guards in Iran's political landscape. The talks are expected to address key issues surrounding the conflict and aim to establish a framework for peace. Observers are closely watching how the involvement of the Revolutionary Guards will impact the discussions and the potential outcomes of these negotiations. #Iran#LeadershipRevamp#PeaceTalks#RevolutionaryGuards#USIranRelations#PoliticalLandscape#ConflictResolution#IranPolitics#PeaceNegotiations

Crypto M - Crypto News

@CryptoM · Post #64623 · 09.04.2026 г., 11:46

🚀 Democratic Republic of Congo Launches Maiden Eurobond Amid Eased Tensions The Democratic Republic of Congo has initiated the sale of its first eurobond, capitalizing on a temporary lull in hostilities between the U.S. and Iran. Bloomberg posted on X, highlighting that this geopolitical development has increased investor interest in riskier assets. The bond issuance marks a significant step for the Democratic Republic of Congo as it seeks to tap into international financial markets. The pause in tensions has created a more favorable environment for emerging markets to attract investment. This move is part of the country's broader strategy to bolster its economic standing and leverage global financial opportunities. #DemocraticRepublicofCongo#Eurobond#GeopoliticalTensions#USIranRelations#EmergingMarkets#Investment#InternationalFinance#RiskyAssets#EconomicGrowth#FinancialOpportunities

Crypto M - Crypto News

@CryptoM · Post #65058 · 10.04.2026 г., 17:08

🚀 Israel-Hezbollah Conflict Complicates U.S.-Iran Relations The ongoing conflict between Israel and the Iran-backed Lebanese militia Hezbollah is adding complexity to the United States' efforts to resolve its longstanding tensions with Iran. Bloomberg posted on X, highlighting the intricate geopolitical dynamics at play. The hostilities between Israel and Hezbollah have intensified, with both sides engaging in military actions that threaten to escalate further. This situation is complicating U.S. diplomatic strategies aimed at de-escalating tensions with Iran, as Hezbollah's actions are closely linked to Iranian interests in the region. The U.S. has been attempting to negotiate with Iran to address various issues, including nuclear capabilities and regional influence. However, the involvement of Hezbollah, a significant player in the Middle East conflict, poses challenges to these diplomatic efforts. As the situation unfolds, the international community is closely monitoring developments, with concerns about potential broader implications for regional stability. The U.S. continues to navigate these complex relationships, seeking a resolution that addresses both its strategic interests and the security concerns of its allies in the region. #Israel#Hezbollah#USIranRelations#MiddleEastConflict#Geopolitics#USDiplomacy#Iran#Lebanon#RegionalStability#NuclearNegotiations#MilitaryEscalation#InternationalRelations