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

Резултати

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

Пребарај: #tradingvolume

当前筛选 #tradingvolume清除筛选
Venture Village Wall 🦄

@venturevillagewall · Post #3854 · 12.01.2025 г., 07:00

Altcoin Trading Surges on Binance In January, altcoin trading volume on Binance reached 77.83%, marking an 11% increase over the past five months, according to CryptoQuant analyst. The rising metric boosts confidence in a potential altcoin bull market in 2025, up from just 50% last May. #Altcoins#Binance#CryptoQuant#MarketTrends#BullMarket #2025 #TradingVolume#Crypto

Crypto M - Crypto News

@CryptoM · Post #65022 · 10.04.2026 г., 14:14

🚀 Tether's USDT Adoption Surges on Hyperliquid On April 10, Tether CEO Paolo Ardoino announced that the adoption of USDT on Hyperliquid is rapidly increasing. According to BlockBeats, data reveals that USDT's share on Hyperliquid has grown significantly in less than three months, now accounting for 7.8% of the total trading volume on HIP-3. #Tether#USDT#Hyperliquid#Cryptocurrency#Blockchain#TradingVolume

Crypto M - Crypto News

@CryptoM · Post #64860 · 10.04.2026 г., 05:07

🚀 XRP Rises to $1.35 Amid Strong Trading Volume XRP experienced a price increase, reaching $1.35 after surpassing the $1.34 mark on strong trading volume. According to NS3.AI, the upward movement paused below $1.36, and XRP continues to be part of a broader downtrend. There is no clear catalyst identified for this recovery. #XRP#cryptocurrency#tradingvolume#priceincrease#downtrend#NS3AI

Crypto M - Crypto News

@CryptoM · Post #65416 · 13.04.2026 г., 06:17

🚀 Bitcoin Needs to Surpass $76,000 to Reverse Downtrend Bitcoin's recent performance indicates a need to break above $76,000 with significant trading volume to counteract its six-month downtrend. According to NS3.AI, the cryptocurrency rebounded from approximately $60,000 in early February, climbing above $75,000 before encountering resistance at its downtrend line. #Bitcoin#cryptocurrency#downtrend#NS3AI#tradingvolume#marketresistance#cryptomarket#BTC

Crypto M - Crypto News

@CryptoM · Post #64561 · 09.04.2026 г., 08:04

🚀 Oil Trading Volume Surpasses Bitcoin for the First Time On April 9, official data from Hyperliquid revealed that the combined trading volume of WTI and Brent oil has surpassed that of Bitcoin for the first time. According to BlockBeats, Bitcoin's trading volume reached $2.29 billion, while WTI crude oil recorded a trading volume of $1.68 billion and Brent crude oil reached $770 million. #OilTrading#Bitcoin#WTI#BrentCrude#TradingVolume#Crypto#Commodities#BTC

Crypto M - Crypto News

@CryptoM · Post #65419 · 13.04.2026 г., 06:34

🚀 Polymarket Predicts High Valuation for Genius Launch Polymarket has forecasted a high valuation for the launch of Genius, with a 99% probability that its fully diluted valuation (FDV) will exceed $20 million on the day following its debut. According to Foresight News, the market also predicts a 97% chance of the FDV surpassing $50 million and a 96% chance of it exceeding $80 million. Currently, the trading volume in this prediction market has surpassed $900,000. #Polymarket#GeniusLaunch#ValuationPrediction#FDV#TradingVolume#Cryptocurrency#MarketForecast

Crypto M - Crypto News

@CryptoM · Post #64669 · 09.04.2026 г., 13:20

🚀 Crypto Trading Volumes Decline in March 2026 Spot trading volume across major exchanges experienced a decline of approximately 19.4% in March 2026 compared to February 2026. According to NS3.AI, derivatives trading volume also saw a decrease, falling about 2.9% month over month. This reduction in trading activity highlights a shift in market dynamics during this period. #CryptoTrading#TradingVolume#MarketTrends#Cryptocurrency#SpotTrading#Derivatives#March2026#CryptoMarket#NS3AI

Venture Village Wall 🦄

@venturevillagewall · Post #3937 · 21.01.2025 г., 10:00

Hyperliquid Hits $22 Billion Volume Hyperliquid reports a record-high trading volume of $22 billion in just 24 hours. This marks a significant milestone in its operational activity, showcasing growing interest in DeFi. 🔗 Read more: Hyperliquid report #Hyperliquid#DeFi#Crypto#Blockchain#TradingVolume#Fintech#Finance#MarketTrends#Investing#TechNews#Altcoins#Ethereum#Bitcoin#DecentralizedEconomy#Liquidity#Tokenomics#Innovation#CryptoMarket#Regulation#DataAnalytics#Web3

Crypto M - Crypto News

@CryptoM · Post #64830 · 10.04.2026 г., 02:56

🚀 Zhida Technology Surges Over 23% on Inclusion in Stock Connect Zhida Technology (02650.HK) experienced a significant increase in its stock price, rising over 23% with a trading volume exceeding 50 million yuan. According to Jin10, the surge follows the announcement that Zhida Technology has been included in the list of eligible securities for the Shanghai-Hong Kong Stock Connect and Shenzhen-Hong Kong Stock Connect programs. This inclusion is expected to enhance the company's visibility and accessibility to investors, potentially driving further interest and investment. #ZhidaTechnology#StockConnect#ShanghaiHongKongStockConnect#ShenzhenHongKongStockConnect#StockSurge#Investment#TradingVolume

Crypto M - Crypto News

@CryptoM · Post #65127 · 11.04.2026 г., 07:16

🚀 Rory McIlroy's Chances to Win 2026 US Masters Surge to 70% on Polymarket According to NS3.AI, the probability of Rory McIlroy winning the 2026 US Masters has increased significantly on Polymarket, reaching 70% after a 46% rise within 24 hours. The trading volume for the 2026 US Masters Champion contract has surpassed $107 million, indicating strong investor interest and activity. #RoryMcIlroy#USMasters2026#Polymarket#Golf#SportsBetting#Investment#TradingVolume#Championship

Venture Village Wall 🦄

@venturevillagewall · Post #3773 · 02.01.2025 г., 10:00

New AI Projects Announced by Binance Binance Alpha reveals new listings: TAOCAT on Base, Swarms and DegenAI on Solana. TAOCAT is a self-improving AI agent; Swarms features a multi-agent LLM framework, while DegenAI supports the autonomous Degen Spartan AI. In related news, AI Meme tokens' market cap has surged to over $10B, with ai16z leading at $2.659B. Full details available on CoinGecko. #Binance#AI#Crypto#Blockchain#TAOCAT#Swarms#DegenAI#AIMemeTokens#MarketCap#CoinGecko#Bittensor#Solana#TradingVolume#CryptoNews#VC

Crypto M - Crypto News

@CryptoM · Post #64555 · 09.04.2026 г., 07:45

🚀 PRECIOUS METALS | XAUt0 Dominates Byreal Trading Volume XAUt0 has emerged as a leading platform for trading gold on the blockchain, with its trading volume surpassing $1.8 million in the past 24 hours on Byreal. According to Foresight News, the platform's market share exceeded 45%, temporarily outpacing competitors Hyperliquid and Orca in the process. #PRECIOUSMETALS#XAUt0#gold#blockchain#Byreal#tradingvolume#marketshare#ForesightNews#Hyperliquid#Orca#XAUT

12
ПретходнаСтраница 1 од 2Следна