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

Резултати

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

Пребарај: #apy

当前筛选 #apy清除筛选
UXLINK

@uxlink_community · Post #180 · 13.01.2025 г., 06:14

Congrats #UXLINKseason1 stakers! After 6 months, $UXLINK price raised from $0.2 to $1.2, with nice #APY average on around 50%, you've got 750%+ ROI on average, the best investment in this market! Like @cz_binance said before, " If you hold, you will be rich! "💰 We will continue empower $UXLINK and reward our long term holders❤️https://x.com/UXLINKofficial/status/1878686684432486624

TONlines – News

@tonlines · Post #7331 · 22.05.2025 г., 16:35

The Daily TON: Understanding APY for Beginners #APY#network The Daily TON highlights the importance of understanding APY, advising newcomers to approach it with caution due to potentially misleading high rates. Services may use high APYs for marketing or short-term benefits, which might not result in significant long-term gains. Source: link @tonlines

Hashtags

🏦TON DeFi Yields & New Players Since the start of the year, 12 new DeFi protocols have launched, and developers are actively experimenting with solutions that combine the convenience of Telegram with the principles of decentralized finance. Top APRs: 🏆Bidaskoffers 22% APR in the tgUSD/USDT pair and 41.6% APR in Bemo bmTON/TON. 🏆TONCOprovides ~37.7% APR — among the highest yields on the platform. 🏆Storm Tradeoffers Vault to TON and USDT with yields of ~10–13% APR. 🏆FIVA Protocolhas revamped its app for simplicity and even added a game mode — 11.25% APR in USDT. New & Rising Projects: 🔓 Factorial has rebranded to Affluent, focusing on straightforward investment tools. 🔓 Titan introduced Colossus — a high-speed concentrated liquidity market-maker. 🔓Syde.fi launched an alpha version and is in testing; the team has gathered feedback and is about to unveil a new synthetic token-asset product. 🔓Swap.coffee opened Coffee DEX — a fully open-source decentralized exchange. 🔓Torch launched tgUSD, a stablecoin pegged 1:1 to USDT, offering ~10% APR. #DeFi#Yield#APR#APY#Farming#TON#Tonco#Bidask#Torch

Crypto M - Crypto News

@CryptoM · Post #65047 · 10.04.2026 г., 16:10

🚀 Whop Introduces Treasury Yield Product Following Tether Investment Whop has launched its Treasury yield product on March 25, following a significant investment from Tether in February, which valued the company at $1.6 billion. According to NS3.AI, the product was introduced after Tether's $200 million investment. Steven Schwartz noted that 3% of users engaged with the beta version within a week, despite the absence of a marketing campaign. The product channels funds through a Veda vault on Plasma into Aave lending markets, offering an annual percentage yield (APY) of up to 6%. The investment from Tether will enable Whop to integrate on-platform USDT wallets and payment options. #Whop#Tether#TreasuryYield#Investment#Crypto#APY#Aave#USDT#Fintech#Blockchain#AAVE

Ganar Dinero Seguro

@ganardineroseguro · Post #1236 · 20.10.2025 г., 00:03

💰 ¡NUEVA FUNCIONALIDAD: CUENTAS DE AHORRO EN 🔤🔤🔤🔤! 💰 🏦 Protege tu dinero de la inflación y hazlo crecer 🎯 QUEREMOS TU OPINIÓN ANTES DE LANZAR ✨ ¿Cómo funcionaría? 📈 APY: 3.75% - 4.10% anual 💵 Ahorra en QUSD - Protección contra inflación 🔓 Sin período de bloqueo - Retira cuando quieras 🚀 Lanzamiento: Noviembre 2025 🤔 PREGUNTA CLAVE: ¿Cómo prefieres recibir tus ganancias de ahorro? 📊 VOTA TU OPCIÓN FAVORITA EN LAS REACCIONES: 👍 DIARIAS - Ganancias acreditadas cada día ❤️ SEMANALES - Ganancias cada 7 días 🔥 MENSUALES - Ganancias cada mes 🥰 ANUALES - Ganancias al final del año 💡 Beneficios de las Cuentas de Ahorro QvaPay: ✅ Rendimiento garantizado - 3.75% a 4.10% APY ✅ Sin bloqueo de fondos - Liquidez total ✅ Protección contra inflación - Ahorra en QUSD ✅ Crecimiento automático - Tu dinero trabaja por ti ✅ Seguridad QvaPay - Respaldado por nuestra plataforma ✅ Flexibilidad total - Deposita y retira cuando quieras 🎯 Ejemplos de ganancias (APY 4%): 💵 Ahorras $100 → Ganas ~$4/año 💵 Ahorras $1,000 → Ganas ~$40/año 💵 Ahorras $10,000 → Ganas ~$400/año 📊 Según tu voto: • Diarias: Pequeñas ganancias constantes cada día • Semanales: Acumulación semanal visible • Mensuales: Crecimiento mensual significativo • Anuales: Máximo rendimiento al final del período 🚀 ¿Por qué es importante este producto? 💼 Para ti: Protege tu dinero y hazlo crecer 📈 Para QvaPay: Instrumento de crecimiento sostenible 🌟 Para todos: Ecosistema financiero más robusto 💬 ¡TU OPINIÓN DEFINE EL PRODUCTO! 👇 VOTA AHORA y ayúdanos a crear la mejor experiencia de ahorro 👇 🗓️ Lanzamiento previsto: Noviembre 2025 #QvaPay#CuentasDeAhorro#APY#QUSD#Ahorro#ProteccionInflacion#Noviembre2025#Encuesta#Inversion#CrecimientoFinanciero#SinBloqueo#Flexibilidad ⚡️Boost | 📱Twitter | 📱Instagram 🌟TrustPilot | ↔️Ofertas | 🤖Bot