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

Резултати

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

Пребарај: #intelligentassets

当前筛选 #intelligentassets清除筛选
Go! Announcements

@gorwachain_announcements · Post #1076 · 06.11.2025 г., 15:45

🎉 Wake up Assets! 🎉 ⚡️🚀 TODAY’S MISSIONS ✅ Check-in on the Go! App → app.gosmartchain.ai to keep your streaks + XP alive. ✅ Use the new @goagenticbot → t.me/goagenticbot - Simulate your first intelligent real-world asset (car, watch, home, artwork…) - Your assets now think, learn, and talk back. Share your creation in the TG groups and get 5 $GSMC for each share! 💬 Try it: t.me/goagenticbot→ use #AgenticAsset#GoRWA#AI#RWA ✅ Health Hero check-in: @healthheroapp_bot → /start → /log or /workout (+40 XP w/photo) ✅ Zealy Leaderboard: (New one going live today! https://zealy.io/cw/gorwachain/leaderboard/2623fee8-db99-41c9-a059-2a24c54858d3) — every action earns points toward early airdrops. ✅ TaskOn Quest: Start Now: https://taskon.xyz/quest/652417804 — complete the new Go! missions. ✅ Post your best content on X: https://x.com/gorwachain @ us! #crypto#RWA#AI#DeFi#wellness#fitness#agentic#health 🤖 Meet the Go! Agentic Bot 🧱 Simulate a Sentient Asset: bring a car, watch, or collectible to life in seconds. 🙋🏽‍♂️ Pledge Your Asset: mint your real item as an intelligent twin on Go! Marketplace. 🏢 Pledge for a Company: refer a business with ≥ $1 M in tokenizable assets → earn a referral reward through our Ambassador Program. 💰 Early pledgers will hold the most valuable early assets on the Go! Marketplace and share in transaction value when their assets trade details dropping soon. 💎 The Intelligent Asset Economy Go! and Health Hero are building a world where every action = ownership. Go! powers the AI + RWA layer the brain of the Intelligent Asset Economy. Health Hero turns your wellness, discipline, and consistency into tokenized rewards. $GSMC is the gas + governance token that fuels it all. Earn $GSMC by checking in daily, completing Zealy + TaskOn missions, using the Agentic Bot, and staying active in the community. 🌍 Mission & Vision Recap “We’re building the world’s first Intelligent Asset Economy, where every person and every asset can think, earn, and grow together.” 💫 Our Values: • Faith in People: Human energy is the most valuable asset. • Intelligence in Action AI + Blockchain should serve real lives. • Wellness = Wealth, A healthy world is a wealthier world. • Community: We win together. 🦾 Bonus Missions 🏗 Node Owners: Own a Go! Agentic Node → nodes.gosmartchain.ai 🎁 XP to Token Conversion: Health Hero XP → Tokenized Rewards soon 💰 🧩 Ambassador Program: Refer companies with RWA portfolios and earn rewards: https://whitepaper.gosmartchain.ai/go-programs/ambassador-program 🔥 In Short This week’s energy = participate + create + share. Make your first asset sentient. Show it off. Tag #GoRWA#Agentic#IntelligentAssets. Let’s Go! 🌍💪

Go! Announcements

@gorwachain_announcements · Post #1072 · 04.11.2025 г., 16:24

🎉 NEW WEEK, NEW MAGIC: The Age of Sentient Assets Begins 🎉 While the market’s waking up, the Go! Fam is way ahead, you’re not just holding tokens, you’re creating living, intelligent assets. The Agentic Sprint continues, and the newest mission is pure 🔥. ⚡️🚀 TODAY’S MISSIONS (New + Core) ✅ Check-in on the Go! App → app.gosmartchain.ai to keep your streaks + XP alive. ✅ Use the new @goagenticbot → t.me/goagenticbot - Simulate your first intelligent real-world asset (car, watch, home, artwork…) - Share your Sentient Card to Telegram or X → use #AgenticAsset#GoRWA#AI#RWA ✅ Health Hero check-in: @healthheroapp_bot → /start → /log or /workout (+40 XP w/photo) ✅ Zealy Leaderboard: (New one going live today! https://zealy.io/cw/gorwachain) — every action earns points toward early airdrops. ✅ TaskOn Quest: Start Now: https://taskon.xyz/quest/652417804 — complete the new Go! missions. ✅ Post your best content on X: https://x.com/gorwachain @ us! #crypto#RWA#AI#DeFi#wellness#fitness#agentic#health 🤖 Meet the Go! Agentic Bot Your assets now think, learn, and talk back. 💬 Try it: t.me/goagenticbot 🧱 Simulate a Sentient Asset: bring a car, watch, or collectible to life in seconds. 🙋🏽‍♂️ Pledge Your Asset: mint your real item as an intelligent twin on Go! Marketplace. 🏢 Pledge for a Company: refer a business with ≥ $1 M in tokenizable assets → earn a referral reward through our Ambassador Program. 💰 Early pledgers will hold the most valuable early assets on the Go! Marketplace and share in transaction value when their assets trade details dropping soon. 💎 The Intelligent Asset Economy Go! and Health Hero are building a world where every action = ownership. Go! powers the AI + RWA layer the brain of the Intelligent Asset Economy. Health Hero turns your wellness, discipline, and consistency into tokenized rewards. $GSMC is the gas + governance token that fuels it all. Earn $GSMC by checking in daily, completing Zealy + TaskOn missions, using the Agentic Bot, and staying active in the community. 🌍 Mission & Vision Recap “We’re building the world’s first Intelligent Asset Economy, where every person and every asset can think, earn, and grow together.” 💫 Our Values: • Faith in People: Human energy is the most valuable asset. • Intelligence in Action AI + Blockchain should serve real lives. • Wellness = Wealth, A healthy world is a wealthier world. • Community: We win together. 🦾 Bonus Missions 🏗 Node Owners: Own a Go! Agentic Node → nodes.gosmartchain.ai 🎁 XP to Token Conversion: Health Hero XP → Tokenized Rewards soon 💰 🧩 Ambassador Program: Refer companies with RWA portfolios and earn rewards: https://whitepaper.gosmartchain.ai/go-programs/ambassador-program 🔥 In Short This week’s energy = participate + create + share. Make your first asset sentient. Show it off. Tag #GoRWA#Agentic#IntelligentAssets. Let’s Go! 🌍💪