@Dogdata · Post #2235 · 20.07.2020 г., 21:05
#Bone live on Coingecko🚀🧨 👉https://www.coingecko.com/en/coins/bone #DogData🐾
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
Пребарај: #dogdata
@Dogdata · Post #2235 · 20.07.2020 г., 21:05
#Bone live on Coingecko🚀🧨 👉https://www.coingecko.com/en/coins/bone #DogData🐾
@Dogdata · Post #2316 · 31.07.2020 г., 17:09
Happy #EidMubarak Best wishes for all DogData Muslim Community Thank you for your kind support 🙏 #DogData#Dogs#EidMubarak 🤩🚀📈😍🤩🚀📈😍🤩🚀📈
Hashtags
@Dogdata · Post #2394 · 14.08.2020 г., 11:08
DogData community🐾 Support us and vote for DogData🙏🐾 Please tag 👇 @FaceBook4Dog#ethbn#bone#dogdata https://twitter.com/gate_io/status/1293863802019119105?s=09 👆👆👆
@Dogdata · Post #2392 · 13.08.2020 г., 19:17
DogData community🐾 Everyone should be interested in getting this. Let's show that we are big, let's show that our community is huge ❗️❗️ Support us and vote for DogData🙏🐾 Please tag 👇 @FaceBook4Dog#ethbn#bone#dogdata https://twitter.com/gate_io/status/1293863802019119105?s=09 👆👆👆
@dogdata · Post #4351 · 08.11.2023 г., 07:01
Let’s bring the Dogs Data to TikTok Join the 🐾 TikTok community Like and share our videos their whenever you can https://www.tiktok.com/@kennel.ai?_t=8h0SUOsjUHI #DogData #$DOGS #Web3#DogBreeder#DogNFT
Hashtags
@dogdata · Post #4338 · 02.11.2023 г., 07:01
Let’s bring the Dogs Data to TikTok Join the 🐾 TikTok community Like and share our videos their whenever you can https://www.tiktok.com/@kennel.ai?_t=8h0SUOsjUHI #DogData #$DOGS #Web3#DogBreeder#DogNFT
Hashtags
@Dogdata · Post #2434 · 19.08.2020 г., 05:32
This is the first of the articles on DogData👏👏 #ETHBN#dogdata#publish0x 👉https://www.publish0x.com/dogdata/mydogdata-xnlwvqz Please rate this article👍🐾
Hashtags
@Dogdata · Post #2497 · 09.09.2020 г., 13:47
💸DogData Wallet 💸 🗓Launched This Week All who registered on the DogData web page should feel free to check up their DogData wallet 🚀 👉https://t.co/JNmxHEyQWw #DogData#Dogs#wallet#cryptocurrencyhttps://t.co/In7tQYMYio
@Dogdata · Post #2453 · 25.08.2020 г., 08:50
🚨Amazing news!📢 We were chosen to be listed on Bitforex CApp!😱🚀 #DogData#Bitforex#Capp
@Dogdata · Post #2271 · 26.07.2020 г., 09:28
🚨🚨TODAY 🚨🚨 #26 July 2020 LIVE AMA🤩📣 #DogData CFO Thomas Melchior With the support #EXCOINCIAL Team 🔴Get your questions prepared. 🔴 Maximum 2 questions per person. THE EVENT HOSTED ON #AFRICUNIA TV Facebook: https://www.facebook.com/africuniatv Instagram: https://www.instagram.com/africuniatv Zoom: https://zoom.us/j/6331039454
Hashtags
@dogdata · Post #4371 · 12.12.2023 г., 07:31
$Dogs token is the governance token for Kennel.Ai platform Web3 on chain platform Where pet dog breeders can tokenise pet dogs using NFT Blockchain is the best way to decentralise dog data Blockchain has created for pet dog breeders the opportunity to manage the industry themselves instead of having to pay and being governed by a centralised organisation #DogData#FCI#DogBreeder#blockchain#Decentralised
@dogdata · Post #4360 · 23.11.2023 г., 07:01
$Dogs token is the governance token for Kennel.Ai platform Web3 on chain platform Where pet dog breeders can tokenise pet dogs using NFT Blockchain is the best way to decentralise dog data Blockchain has created for pet dog breeders the opportunity to manage the industry themselves instead of having to pay and being governed by a centralised organisation #DogData#FCI#DogBreeder#blockchain#Decentralised