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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #22 · 19 јан.

Заметка начинающим, которые часто сталкиваются с подобной непоняткой. Ситуация следующая, есть список файлов: names = [ 'image.bmp', 'second.txt.bkp', 'data.db', '.config.cfg', 'file.ext.bkp' ] И мы хотим убрать у них окончание ".bkp". Не знаю зачем, пример довольно надуманный) Но суть он показывает, а это главное. Те, кто еще не очень знаком с библиотекой os.path или pathlib, вероятно решат обработать имена как строки. И тут вполне подойдет метод строки strip(). Что делает этот метод? Он отрезает указанные символы по обеим сторонам строки. Если ничего не указать, то убирает невидимые символы (пробелы, табуляции и переносы строк). В нашем случае будет выглядеть вот так: >>> name.strip('.bkp') То есть просим удалить строку '.bkp' по краям имени файла, если таковая есть. Можно применить аналогичный метод rstrip(), чтобы отрезать только справа, но для этого примера используем обычный. >>> for name in names: >>> print(name.strip('.bkp')) image.bm second.txt data.d config.cfg file.ext Хм, что-то не то с нашими именами! Что случилось??? Видим нежелательное переименование в именах, где и близко не было указанной строки '.bkp' А дело всё в том, что данный метод ищет не указанную строку, а указанные символы, и не важно в каком порядке. Для метода strip() строка '.bkp' это не паттерн для поискаа список символов. Потому он отрезал симовол 'p' от '.bmp' и удалил точку из файла '.config.cfg'. Как тогда правильно заменить именно паттерн? Для начинающего можно посоветовать метод строки replace(), который как раз использует для замены указанную строку целиком. В нашем примере заменим её на пустую строку. >>> for name in names: >>> print(name.replace('.bkp', '')) image.bmp second.txt data.db .config.cfg file.ext Уже лучше, но помните, это лишь пример про strip(). Для работы с именами файлов есть способы и более "правильные", дающие однозначно верный результат. Я взял файлы только в качестве примера. Даже replase() тут может сделать не то что ожидаем. Просто впредь будьте внимательны с этим strip(). #basic

Hashtags

Резултати

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

Пребарај: #debark

当前筛选 #debark清除筛选
Red Nile

@rednile12 · Post #11017 · 16.02.2026 г., 16:08

📝ANALYSIS: The Unmasking of Addis Standard: Independence or Illusion? ✍🏽By Dhuga Bilisuma | Red Nile Contributor 📅 February 16, 2026 In a detailed piece for RedNile, contributor Dhuga Bilisuma subjects Addis Standard’s recent coverage to rigorous academic scrutiny, questioning whether the outlet’s self-proclaimed “independence” withstands analytical review. Drawing from established media theory — including the framing work of Robert Entman and agenda-setting theory — the article examines three editorial patterns from January–February 2026 that raise concerns about conflict-sensitive reporting standards in Ethiopia’s fragile post-conflict environment. 1️⃣ Territorial Framing: “Wolkait” vs. “Western Tigray” When Prime Minister Abiy Ahmed referred to “Wolkait” during parliamentary remarks, Addis Standard’s headline substituted the term with “Western Tigray.” 📌The Critique: Framing theory suggests such terminology shifts are not neutral. In a contested territorial dispute, choosing nomenclature different from the speaker’s own wording can signal narrative alignment — especially when competing historical and constitutional claims are involved. The report, according to Bilisuma, lacked the contextual clarification recommended by conflict-sensitive journalism standards. 2️⃣ Agenda-Setting: Selective Visibility of Protests In late January, demonstrations reportedly took place in #Telemt, #Humera, #Wofla, #Korem, #Zata, #Dabat, #Debark, and #Dejach_Meda, with protesters calling for full implementation of the 2022 Pretoria Peace Agreement. #AddisStandard reportedly provided no coverage of these protests. 📌The Critique: Agenda-setting theory argues that what media omits can be as influential as what it highlights. For diaspora readers — who rely heavily on English-language reporting — such omissions may shape international perception by rendering certain grievances invisible in global discourse. 3️⃣ Post-Publication Revision: The “Maneuver” Case In reporting remarks from the Tigray Interim Administration, the outlet initially used the military term “maneuvering” to describe troop movements. 📌The Critique: While revisions are common in journalism, Bilisuma points to a pattern of reactive, non-transparent language adjustments. In a post-conflict setting governed by the Pretoria Agreement, terms like “maneuver,” “movement,” or “deployment” carry significant implications regarding compliance or breach. Inconsistent transparency in edits can undermine public trust. 4️⃣ The Broader Pattern: Asymmetrical Context The article argues that detailed historical grievances and counter-arguments are frequently added when framing federal officials. However, similar contextual depth is not consistently applied when reporting on actors associated with #TPLF leadership. 📌The Critique: This uneven distribution of contextual scrutiny may generate cumulative narrative asymmetry — shaping reader perception without explicit editorial positioning. 🧭 The Verdict Bilisuma stops short of alleging intentional bias. Instead, he argues that the cumulative effect of terminology choices, selective coverage, and revision practices constructs a particular political terrain for readers. For diaspora audiences — whose understanding of events often depends on outlets like #AddisStandard — these framing dynamics carry amplified consequences. “Media independence is not established solely through mission statements. It is demonstrated through transparent editorial standards.” ♦️Bottom Line: A must-read for anyone who consumes Ethiopian media critically. In fragile post-conflict societies, framing is never just semantics — it is politics. 📌Read the full article here: The Unmasking of Addis Standard: Independence or Illusion? #Ethiopia#MediaAnalysis#AddisStandard#RedNile#ConflictReporting#Framing