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 слични објави

Пребарај: #postquantumsecurity

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

@CryptoM · Post #65449 · 13.04.2026 г., 09:15

🚀 Zcash Open Development Lab Unveils Strategic Direction Focused on Post-Quantum Security On April 13, Zcash Open Development Lab (ZODL) founder Josh Swihart announced the latest developments for Zcash, emphasizing a strategic direction centered on post-quantum security, scalability, and user experience. According to BlockBeats, Swihart likened the initiative to the Artemis II lunar mission, highlighting the pursuit of seemingly impossible goals through technological breakthroughs. The ZODL team revealed that Zcash is entering the 'Zcash IV' phase, aiming to build infrastructure akin to a 'lunar base' to support the protocol and applications' secure expansion to billions of users, while advancing the vision of privacy transactions without large-scale financial surveillance. On the product and technology front, ZODL continues to iterate, with its 3.3.x version now available on iOS and Android, featuring new hardware wallet connection management, SDK upgrades, and multiple user experience enhancements. Key developments include advancing Keystone wallet functionality and upgrading the address system (ZIP 316, UIVK/UFVK). Meanwhile, the Zcash core team has addressed several system issues and is progressing with the Zallet alpha version development, strengthening unified address standards and wallet interaction experience to lay the foundation for future scalability and performance improvements. Additionally, ZODL disclosed ongoing growth in application data and participation in a stablecoin privacy summit to enhance industry collaboration. However, due to increased regulatory and network restrictions, ZODL has temporarily removed its app from Russian app stores. The team emphasized that privacy is not optional but a fundamental need in the digital age, and they will continue to accelerate delivery pace to promote ZEC adoption and ecosystem development. The core of Zcash Open Development Lab is to develop an open, self-custodial private financial platform, aiming to expand ecosystem interoperability through collaboration and bring protected ZEC transactions to the global mainstream market. #Zcash#ZODL#PostQuantumSecurity#Cryptocurrency#Privacy#Blockchain#Scalability#UserExperience#KeystoneWallet#Zallet#Stablecoin#FinancialPrivacy#EcosystemDevelopment#DigitalPrivacy#OpenDevelopment#ZEC