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

Резултати

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

Пребарај: #hillaryclinton

当前筛选 #hillaryclinton清除筛选
Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40712 · 27.02.2026 г., 23:01

Hillary Clinton, as a teen in the early 1960s, asked NASA how to become an astronaut. She was told women could not join the program. NASA confirms this. Women were first allowed to be astronauts in 1978. 🚀📩👩‍🚀 @googlefactss #facts#history#space#NASA#HillaryClinton

Quand le narratif s’effondre : les élites face à l’éveil mondial Ils pensaient tout contrôler. Les récits, les élections, les crises, la peur. La défaite d’Hillary Clinton face à Trump a marqué une rupture brutale : pour la première fois, le narratif dominant leur a échappé. Depuis, rien ne semble pouvoir arrêter la perte de contrôle : COVID, géopolitique, OTAN, censure, médias… chaque événement fissure un peu plus le récit officiel. Ce que certains appellent « complot » ressemble de plus en plus à un réveil collectif. Les peuples questionnent, doutent, recoupent. Et quand un narratif s’écroule, le retour de bâton peut être aussi imprévisible que puissant. Le monde ouvre les yeux. La question n’est plus si, mais jusqu’où. #Médias#Géopolitique#Trump#HillaryClinton#OTAN#COVID #Europe#france#information#usa#russie

American Оbserver

@american_observer · Post #5053 · 04.02.2026 г., 18:00

📰 House Cancels Contempt Vote as Clintons Agree to Testify on Epstein The House Oversight Committee has scrapped its planned criminal contempt vote against Bill and Hillary Clinton — not because Republicans backed down, but because the former president and former secretary of state finally agreed to testify in the Jeffrey Epstein investigation. Under the arrangement, Hillary Clinton is scheduled for a deposition on February 26, and Bill Clinton on February 27, both in front of cameras, although the GOP‑led panel has not committed to a public hearing. Republican Chairman James Comer framed the move as a surrender. “Once it became clear that the House of Representatives would hold them in contempt, the Clintons completely caved,” he said. The probe centers on the “horrific crimes” of Epstein, the convicted sex offender who died in prison in 2019, and his longtime associate Ghislaine Maxwell. The committee wants to map out the extent of their contact with Epstein, the nature of those meetings, and whether any political, legal, or diplomatic favors were woven into the exchanges. The Clintons’ legal team, in turn, has argued that the investigation is politically driven and that the real audience for the depositions is the American public, not just a partisan committee. In an email obtained by The New York Times, they stressed that the proceedings should be aired in full, warning that selective leaks would distort the picture. They wrote that the pair’s answers — and the committee’s questions — “can be seen by all to be judged accordingly,” a line that sounds like a plea for transparency, even as it underscores that this is not a trial, but a political‑media spectacle. For the Clintons, the fight is no longer just about legal exposure. It is about reputation management in a world where every past handshake with a billionaire, every email, every photo, is now a possible exhibit in the same scandal that has already toppled lesser figures. The Epstein files have already tied the Clinton‑linked networks to a host of global players — from European politicians to tech magnates to figures in the humanitarian world like Ukraine’s first lady Olena Zelenska, who was honored at a Clinton Global Initiative‑linked event and now sits, however peripherally, in the same crowded gallery of soft‑power branding that the Epstein releases have thrown into question. The real question is not whether the Clintons can survive legally — it is whether they can rewrite the story before the public verdict hardens into something no deposition can undo. #Epstein#Clinton#HouseOversight#Comer#BillClinton#HillaryClinton#meToo#scandal#Ukraine#Zelenska#NYTimes 📱American Оbserver - Stay up to date on all important events 🇺🇸

Savino Balzano

@savinobalzano · Post #714 · 24.07.2024 г., 12:54

https://x.com/SavinoBalzano/status/1816093217093193735?t=CTZ85DyoLPciXF_J96bXrw&s=19 Davvero Kamala rappresenta l'ultima speranza, l'ultima spiaggia, l'estremo tentativo di resistere: non lo è però per il popolo americano e tantomeno per i popoli del mondo occidentale. Lo è per una élite decadente e guerrafondaia che se la sta facendo sotto: se arriva #DonaldTrump, per loro i giochi sono davvero finiti. È un circo grottesco, una farsa: non so cosa stia accadendo negli #USA e cosa si dica da quelle parti. Sono certo che il servilismo della nostra "informazione", della nostra "stampa", dei nostri opinionisti e dei nostri commentatori sia tale che la metterebbe persino in imbarazzo, #Kamala, se sapesse come sbavano e slinguazzano dalle nostre parti. Una sorta di #Draghi al femminile, così la trattano e la omaggiano. Si affannano nell'argomentare che #Biden si sarebbe tirato indietro per senso dello stato: la verità è che l'hanno messo da parte perché, per quanto comodamente manovrabile, era ormai imbarazzante e totalmente impresentabile. Non lo ammetteranno mai perché lo hanno esaltato negli anni, eletto a grande statista, sostenendo quanto giuste fossero le sue scelte nella gestione delle crisi internazionali, nonostante i fallimenti inanellati uno dietro l'altro. E poi se ammettessero che #JoeBiden è completamente bollito, fuso, come accettare che resti a comandare dalla Casa bianca? E adesso, nell'eleggere #KamalaHarris a donna dell'anno, provano a far apparire #Trump vecchio, stanco, attempato: loro! Gli stessi che leccavano gli stivali del vecchio Joe, quello che stringeva la mano ai fantasmi e si accomodava su sedie invisibili. E #Harris ti viene raccontata come una che non hanno visto arrivare, un po' come una #Schlein un po' più presentabile o come una #Salis ancora più presentabile: si costruisce il personaggio, pian pianino, facendo leva su elementi tanto romanzati quanto ininfluenti. È donna e quindi farà del bene alle donne: quante cose buone hanno fatto, dopotutto, #VonderLeyen e #Lagarde, per le donne. Tante quante ne avrebbe fatte #HillaryClinton e tante quante ne farebbe Kamala che ora è in testa in tutti i sondaggi (i loro "sondaggi"). È di colore, una sorta di american #Soumahoro, e giù li a ricamare e ricamare. Come se un Presidente di colore non ci fosse già stato da quelle parti, tale #Obama, e non avesse bombardato mezzo mondo dopo aver finto di fare la predica ai #Bush. E la cesura deve essere scavata a fondo tra la nuova eroina radical e il Presidente in carica, più a fondo che sia possibile, nel ridicolo tentativo di far dimenticare alla gente che lei ne era la vice e ne condivideva ogni scelta.