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

Резултати

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

Пребарај: #halo

当前筛选 #halo清除筛选
Mega Signals Group

@mega_pump_group · Post #1859 · 19.11.2023 г., 18:38

Pump result: Today's pump on Kucoin shocked us all with the massive volume, this was expected as we onboarded over 30,000 members in the past two weeks. However, due to unprecedented sell pressure from the #HALO team, we had expected a much larger rise in price. In fact internally we had discussed that we will be targeting around 900-1000% which we still tried to achieve with our team buying endless amounts after the first few minutes to guarantee that our members make good enough profit . Nonetheless, member's managed to profit over 150% during the signal, and with the support of our team we even managed to provide a second and third wave for extra profits which means anyone that has bought the dips during the signal had the chance to instantly make a lot of profits! We are receiving an overwhelming amount of positive messages from our community and we're happy to hear so many of you profited. From this point on, our signals will only get stronger, and you can be confident that we will use all the power we have to keep reaching higher targets. As the majority of you are aware, our greatest pump to date generated a profit for our members of around 2000%, and now our primary focus is to see if we can repeat that sort of pump. It will be quite easy to accomplish with our existing power. It can happen once again if we don't face any sell pressure coming from the coin team itself which is something that can be hard to avoid at times, hopefully we can achieve that result once again on the next one. Stay tuned for the next pump announcement.

Hashtags

Crypto Pump Club

@crypto_bitcoin_pumps_signal · Post #587 · 19.11.2023 г., 18:39

Pump result: Today's pump on Kucoin shocked us all with the massive volume, this was expected as we onboarded over 30,000 members in the past two weeks. However, due to unprecedented sell pressure from the #HALO team, we had expected a much larger rise in price. In fact internally we had discussed that we will be targeting around 900-1000% which we still tried to achieve with our team buying endless amounts after the first few minutes to guarantee that our members make good enough profit . Nonetheless, member's managed to profit over 150% during the signal, and with the support of our team we even managed to provide a second and third wave for extra profits which means anyone that has bought the dips during the signal had the chance to instantly make a lot of profits! We are receiving an overwhelming amount of positive messages from our community and we're happy to hear so many of you profited. From this point on, our signals will only get stronger, and you can be confident that we will use all the power we have to keep reaching higher targets. As the majority of you are aware, our greatest pump to date generated a profit for our members of around 2000%, and now our primary focus is to see if we can repeat that sort of pump. It will be quite easy to accomplish with our existing power. It can happen once again if we don't face any sell pressure coming from the coin team itself which is something that can be hard to avoid at times, hopefully we can achieve that result once again on the next one. Stay tuned for the next pump announcement.

Hashtags

便宜机场测速

@cheap_proxy · Post #12001 · 05.08.2025 г., 15:37

#halo#iepl#不限速#流媒体解锁#chatgpt 测速环境: #上海电信1000 新开的一家专线机场,入口很多,25r/100g,延迟属于顶级水平。因为用户量少,整体比较稳定,晚高峰速度也很快,性价比还是比较高的。 完整套餐价格图 机场地址:https://bit.ly/halo-cloud

便宜机场测速

@cheap_proxy · Post #11306 · 03.01.2025 г., 08:14

#halo#iepl#不限速#流媒体解锁#chatgpt 测速环境: #上海电信1000 新开的一家专线机场,入口很多,25r/100g,延迟属于顶级水平。因为用户量少,整体比较稳定,晚高峰速度也很快,性价比还是比较高的。 完整套餐价格图 机场地址:https://bit.ly/halo-cloud

便宜机场测速

@cheap_proxy · Post #11276 · 29.12.2024 г., 07:22

#halo#iepl#不限速#流媒体解锁#chatgpt 测速环境: #上海电信1000 新开的一家专线机场,入口很多,25r/100g,延迟属于顶级水平。因为用户量少,整体比较稳定,晚高峰速度也很快,性价比还是比较高的。 完整套餐价格图 机场地址:https://bit.ly/halo-cloud

便宜机场测速

@cheap_proxy · Post #11751 · 08.05.2025 г., 12:09

#halo#iepl#不限速#流媒体解锁#chatgpt 测速环境: #成都移动1000 新开的一家专线机场,入口很多,25r/100g,延迟属于顶级水平。因为用户量少,整体比较稳定,晚高峰速度也很快,性价比还是比较高的。 完整套餐价格图 机场地址:https://bit.ly/halo-cloud

便宜机场测速

@cheap_proxy · Post #11977 · 29.07.2025 г., 01:48

#halo#iepl#不限速#流媒体解锁#chatgpt 测速环境: #河北联通1000 新开的一家专线机场,入口很多,25r/100g,延迟属于顶级水平。因为用户量少,整体比较稳定,晚高峰速度也很快,性价比还是比较高的。 完整套餐价格图 机场地址:https://bit.ly/halo-cloud

便宜机场测速

@cheap_proxy · Post #11479 · 16.02.2025 г., 11:15

#halo#iepl#不限速#流媒体解锁#chatgpt 测速环境: #河北联通1000 新开的一家专线机场,入口很多,25r/100g,延迟属于顶级水平。因为用户量少,整体比较稳定,晚高峰速度也很快,性价比还是比较高的。 完整套餐价格图 机场地址:https://bit.ly/halo-cloud

Interesting Planet 🌍

@interesting_planet_facts · Post #415 · 25.07.2025 г., 14:22

🌎 Sun halos, circular rainbows encircling the sun, form when sunlight passes through high-altitude ice crystals. These brilliant rings are a natural spectacle, often signaling incoming weather changes. ✨ #sun⚡#halo⚡#atmosphere⚡#optics 👉subscribe Interesting Planet

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