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

Пребарај: #scale

当前筛选 #scale清除筛选
America 🇺🇸 News & Politics

@America · Post #10099 · 14.11.2025 г., 02:03

😄Scale ➖➖➖➖➖➖ 🔘 Scale is a measurement used for number and amounts. 🔜 Rate this course on a scale of 1 to 10. 🔘It can also be used to mean the size or extent of something. 🔜 They like to party on a huge scale. 🔘Scale can mean climb. 🔜 The prisoner scaled the prison wall and escaped. 🔘 Fish and reptiles have scales on their body. 🔜 I carefully removed the scales before cooking the fish. #Scale👨‍🏫@America ➖➖➖➖➖➖➖➖➖➖➖➖ 🆕 Crypto News @Money 😁 Crypto Game @Egame 🇺🇸 US News @America 🇯🇵 Japan News @Japan 🇦🇪 UAE News @Dubai ▶️ Popular Movies @Videos 😜 Best Funny Video @Funnys

Hashtags

Пример фармилки жетонов в сети TON. Это пока единственное место куда я закинул свои жетоны #SCALE в стек. Шаг 1. Свапнуть #TON на #SCALE. https://dedust.io/swap Шаг 2. Добавить в стек #SCALE. https://tonraffles.app/jetton/staking Таким образом можно 14 дней фармить жетон #RAFF. APR: 1000% на текущий момент. Не финансовый совет. Риски есть, гарантий нет.

🤔Introducing $DUST, the new name for DeDust.io token $SCALE ➡️$DUST One of the most frequent questions we've been asked in chats and personal conversations over the past year is, "Why doesn't DeDust.io have its own token yet?" and "Why is DeDust.io's token called SCALE?" A long time ago, we planned to name the exchange "Scaleton," but eventually, we came up with a better name—DeDust. While this has created some confusion, $SCALE has still become one of the most popular and well-known tokens in the ecosystem. This rebranding aims to make our token even more recognizable and widely known, improving its branding and strengthening its connection to our product. Today, we are thrilled to announce the rebranding of $SCALE to $DUST. Holders don’t need to take any action— the contract address and on-chain data will remain the same; only the name will change. We will reach out to all analytics platforms and ask them to update the token display accordingly. Additionally, we plan to highlight $DUST more prominently on the homepage of our exchange. The complete rebranding process will take some time, but in the meantime, share your thoughts on this update in the comments, and of course, tell all your frens about the update. We all knew this would happen sooner or later. Sincerely, Scaleton team #TON#DeDust#Scale#DUST

Venture Village Wall 🦄

@venturevillagewall · Post #3347 · 18.12.2024 г., 12:06

Revi Secures $500K Funding Revi has successfully raised $500K in funding as of December 4, 2024. The platform offers precise and scalable workflows for identifying, researching, and tracking M&A targets. #Funding#M&A #Startups#Investment#AI#Tech#Research#Workflows#Revi#Business#Innovation#Scalable#Tracking#Targets#Finance#Growth#Scale#Market#Analysis #2024

Venture Village Wall 🦄

@venturevillagewall · Post #3618 · 21.12.2024 г., 10:22

New Wave Biotech Secures $1.25M Investment New Wave Biotech has raised $1.25M to enhance its Bioprocess Foresight software, which aids biomanufacturing innovations in scaling processes, accelerating commercialization, and promoting sustainability. The software offers bioprocess modeling, operation simulations, and economic analysis tools to optimize biomanufacturing efficiency and sustainability. Learn more at New Wave Biotech. #Biotech#Funding#Bioprocessing#Sustainability#Software#Investment#SupplyChain#Innovation#TechAnalysis#Manufacturing#Commercialization#Scale#AnalysisTools#ProcessModeling#Downstream#TechEconomic#ProcessOptimization#GlobalSupplyChain