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

Резултати

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

Пребарај: #doublezero

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

@CryptoM · Post #65441 · 13.04.2026 г., 08:34

🚀 Japanese Game Company WIZE Expands Solana Holdings Japanese game company WIZE, formerly known as Mobcast Holdings, has announced that its cumulative purchase of SOL has reached approximately $3.13 million (500 million yen) as of April 10, 2026. According to Foresight News, the company currently holds over 24,597 SOL, with an average purchase price of around $127 (20,327 yen) per SOL, ranking 15th globally on CoinGecko's 'Solana Treasury Holdings' list. Over the past six months, WIZE has earned more than 400 SOL in staking rewards. The company's 'WIZE Validator Node' has officially joined the Solana Foundation's SFDP program and has received delegations from projects like DoubleZero. Including external delegations, WIZE's total treasury amounts to approximately 152,000 SOL. The company aims to further increase its holdings to enter the top 10 globally as soon as possible. #JapaneseGameCompany#WIZE#Solana#SOL#ForesightNews#SolanaTreasuryHoldings#StakingRewards#WIZEValidatorNode#SFDP#DoubleZero#Crypto#Blockchain#Cryptocurrency#GameIndustry

Venture Village Wall 🦄

@venturevillagewall · Post #4317 · 06.03.2025 г., 01:00

Notable Updates on Crypto Events and Funding White House source confirms Cardano's Charles Hoskinson excluded from the March 8 Crypto Summit. Cardano hasn't engaged with the administration in policy talks. Additionally, DoubleZero Foundation raises $28M at $400M valuation, plans expansion. CANARY files S-1 for AXL ETF, focusing on blockchain interoperability. #Cardano#Crypto#Hoskinson#DoubleZero#Blockchain#Funding#AXLETF#Web3#Investing#Valuation#Solana#XRP#Hedera#Stellar#TON#Sui#Bitcoin#VC#Testnet

Venture Village Wall 🦄

@venturevillagewall · Post #4324 · 06.03.2025 г., 19:00

$28M Raised for DoubleZero as Blockchain News DoubleZero secures $28M in funding from Multicoin Capital and others to enhance its network protocol. Tensorplex Labs also gains investment from YZi Labs to develop decentralized AI tools. Texas Senate passes Bitcoin Reserve Bill SB21. TON Core implements "Accelerator" update, boosting throughput to 100,000 TPS. World Liberty Financial partners with Sui, causing SUI price surge. Medusa Ransomware targets over 40 victims in 2025, demanding hefty ransoms. Kraken to begin next round of FTX creditor repayments on May 30. Seismic raises $7M led by a16z for a privacy blockchain. More on Bitcoin, blockchain, and crypto developments can be found at the relevant links. #Funding#Blockchain#Bitcoin#TexasSenate#Crypto#AI#Tensorplex#Web3#DoubleZero#SUI#Seismic#Ransomware#Medusa#A16z#DeFi#DecentralizedAI#TON#Kraken#VentureCapital