@marwa_osmanlb · Post #5091 · 01.12.2025 г., 20:52
Israel not only killed American activist Rachel Corrie in Gaza in 2003 (20 years before October 7), it also makes fun of her death with "Rachel Corrie Pancakes" day. #fyi
Hashtags
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
Пребарај: #fyi
@marwa_osmanlb · Post #5091 · 01.12.2025 г., 20:52
Israel not only killed American activist Rachel Corrie in Gaza in 2003 (20 years before October 7), it also makes fun of her death with "Rachel Corrie Pancakes" day. #fyi
Hashtags
@gzx7301 · Post #3162 · 21.09.2025 г., 04:12
#FYI 所有人停止异地补办上海移动卡!!!上海移动出了大事情,从9/12开始,所有异地补办的卡全部都会涉诈停机,需要人到上海解锁,同时停止了线上补卡渠道,出了2000多张涉案卡。 这个功能短期内不会恢复,而且在另行通知之前,异地补卡全部都会局停并让人到上海解锁! 各位,千万不要异地补上海移动卡!
Hashtags
@NEASingapore · Post #948 · 16.11.2024 г., 07:12
[Scam Alert] We are aware of a scam involving the impersonation of NEA’s ePortal (www.nea.gov.sg/e-services). Individuals have received SMS urging them to pay fines through a phishing site that requests payment details. The fradulent site has been taken down. The public is advised to remain vigilant and not to engage with these scam accounts or sites. For more scam-related advice, visit www.scamalert.sg. #FYI • Offenders will be notified of enforcement actions in person by authorised officers or via official correspondences such as mail. • If payment has not been made, a reminder will be sent via SingPass, followed by an SMS if the message remains unread after 24 hours. • All SMSes from NEA will not contain any links.
Hashtags
@mndsingapore · Post #91 · 21.11.2020 г., 12:33
#FYI the Lornie Nature Corridor has opened! With this, residents and Coast-to-Coast Trail users can look forward to using the corridor as a green route between MacRitchie Reservoir Park and Adam Road. 🌳 The Lornie Nature Corridor and Kheam Hock Nature Way will form an ecological corridor linking the Central Catchment Nature Reserve to the Singapore Botanic Gardens. 🌳 With this, our native biodiversity will be able to move seamlessly between these key habitats. These are part of efforts to intensify greening across our island, protecting our natural ecosystems and weaving greenery into our urban spaces and infrastructure. 👉 Read more at: https://www.mnd.gov.sg/newsroom/speeches/view/opening-remarks-by-minister-desmond-lee-at-the-launch-of-lornie-nature-corridor 🔔 Help spread the word about MND's Telegram channel for the latest updates https://t.me/MNDSingapore
Hashtags
@ciceros_self_talk · Post #42 · 17.02.2025 г., 12:05
#FYI
Hashtags
@swift_airdrops · Post #5915 · 27.07.2025 г., 18:52
✨ Airdrop FYI For All & #FYI TGE 21 AUG & Early users qualify for the Airdrip $FYI rewards based weekly medals, final rankings, and engagements in the Flagship ecosystem. 👉 Join Airdrop here :- https://agents.flagship.fyi/?ref=k6n4kdroivmrxlh6ejtj43xf ➖ REGISTER WITH DC ➖ GO TO QUEST ➖ COMPLETE TASK AND GET SPINS ➖ SPIN AND EARN FYI ➖ GO TO AIRDROP ➖ UP YOUR HUMANITY SCORE TO 10 & DONE #Note :- The Token Generation Event (TGE) is expected to happen on August 21, 2025. Keep an eye on the official Flagship channels for updates.
@orizzontipolitici · Post #409 · 12.01.2020 г., 16:47
#FYI: Repubblica di Cina 🇹🇼 e Repubblica Popolare Cinese🇨🇳 A seguito della Guerra Civile Cinese, i nazionalisti del Kuo Ming Tang (#KMT) persero e si ritirarono nelle isole al largo della Cina, in particolare Formosa, che ospita oggi la Repubblica di Cina (ROC). Il Partito Comunista Cinese (#CPC) conquistò invece la Cina continentale, inaugurando la Repubblica Popolare Cinese (PRC). Ad oggi, i due Paesi, che sono de facto indipendenti tra loro, non riconoscono i rispettivi governi; al contrario, entrambi si ritengono legittimi governatori di tutta la Cina, ivi inclusi i territori controllati dalla controparte. Riconoscimento🇺🇳 Per un lungo lasso di tempo le Nazioni Unite, gli USA e gran parte dell'Occidente riconobbero come legittimo il governo della ROC, mentre i Paesi comunisti sostenevano la PRC. Tutto cambiò con la Risoluzione ONU 2758 del 1971, che ribaltò completamente la situazione: oggi solo 14 Paesi (più la Santa Sede) riconoscono Taiwan, mentre gli altri riconoscono la PRC. Anche all'interno dell'ONU la rappresentanza della Cina spetta alla PRC, mentre la ROC ne è stata espulsa proprio con quella risoluzione. I Paesi che oggi riconoscono Taiwan sono: 🇧🇿 Belize 🇸🇿 Eswatini 🇬🇹 Guatemala 🇭🇹 Haiti 🇭🇳 Honduras 🇲🇭 Marshall Islands 🇳🇷 Nauru 🇳🇮 Nicaragua 🇵🇼 Palau 🇵🇾 Paraguay 🇰🇳 Saint Kitts & Nevis 🇱🇨 Saint Lucia 🇻🇨 Saint Vincent & the Grenadies 🇻🇦 Santa Sede* 🇹🇻 Tuvalu (*) La Santa Sede non è uno Stato, ma un ente quasi-statale