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

Резултати

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

Пребарај: #gmt

当前筛选 #gmt清除筛选
Pro Analysis

@proanalysistrader · Post #28374 · 07.01.2025 г., 15:36

#GMT/USDT analysis : Following the breakout and subsequent retest of the 200 EMA, the price is now declining. It is anticipated that this downward momentum will persist, leading to a test of lower levels. TF : 4H Entry : $0.1586 Target : $0.1414 SL : $0.1670

Hashtags

Pro Analysis

@proanalysistrader · Post #27827 · 10.08.2024 г., 18:27

#GMT/USDT analysis : #GMT is in an uptrend on LTF. The price has broken and retested the 200 EMA. Currently, the price is bouncing back from the 200 EMA and is expected to continue its bullish momentum. TF : 30min Entry : $0.1132 Target : $0.1199 SL : $0.1089

Hashtags

American Crypto©

@americancryptotrading · Post #27582 · 08.04.2026 г., 10:26

🇺🇸#GMT/USDT is testing the lowerboundary of the descendingchannel pattern on the weekly timeframe💁‍♂️ Bullish if we bounce off the one📈 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27116 · 10.01.2025 г., 14:21

🇺🇸#GMT/USDT is bouncing off the broken descendingtriangle on the weekly chart🔍 More upside if bounce occurs📈 American Crypto©

Hashtags

Crypto Angels

@cryptoangelsusa · Post #22229 · 10.01.2026 г., 01:00

🌊#GMT/USDT: #(Short) ✅Entry zone: 0.01934 ☑️Targets: 0.01905, 0.01886, 0.01866, 0.01837, 0.01818, 0.01789 🚫Stop Loss : 5-10% ⚜️Leverage: Cross (20х)

Hashtags

Binance Mafia

@binancemafia · Post #3544 · 10.03.2025 г., 10:24

#GMT overall trend is bearish, with a significant downtrend visible from the peak in late December.Price has been making lower highs and lower lows, indicating continuous selling pressure. 🔥👍✅ Further,As long as the price stays below $0.0847, the bearish trend remains strong.A potential relief bounce could occur, but confirmation is needed.Bulls need to reclaim resistance levels above $0.0847 to signal a possible trend reversal.👍🔥✅

Hashtags

Binance Mafia

@binancemafia · Post #3420 · 27.01.2025 г., 08:28

#GMT is testing the major support zone and testing the Daily range low. Market is taking a correction before going up and we can see big moves in coming months.🔥✅ Further. GMT is looking good for investment in upcoming Alt Season.🔥✅😍👀✅🔥😳

Hashtags

Binance Mafia

@binancemafia · Post #3183 · 18.11.2024 г., 08:43

#GMT will test the resistance zone and it has caused the liquidity on resistance zones .Market can see a breakout and bullish move soon,🔥✅ Further, market will take a bullish soon ahead as BTC.D will soon take a breakdown.🔥✅😍👀✅🔥😳

Hashtags

Binance crypto champions

@binancecryptochampions · Post #3006 · 09.01.2026 г., 16:31

✴️Free signal-Futures ✴️ ⚡️⚡️#GMT/USDT⚡️⚡️ Signal Type: Regular (Long) Leverage: Cross (20x) Margin: 2.0% Entry Targets: 1) 0.01700 2) 0.01900 Take-Profit Targets: 1) 0.02050 2) 0.02150 3) 0.02350 Stop Targets: 1) 0.01600 🍁 Published by: @Trading_exp🍁 Join_vip: @Crypto_Futures_Spot_Payment_bot

Hashtags

Binance crypto champions

@binancecryptochampions · Post #2398 · 12.06.2025 г., 13:20

✴️Free signal-Futures ✴️ ⚡️⚡️#GMT/USDT⚡️⚡️ Exchanges: Binance Futures, ByBit USDT, KuCoin Futures Signal Type: Regular (Long Leverage: Cross (10.0x) Entry Targets: 1) 0.0519 2) 0.0496 Take Profit Targets: 1) 0.0523 2) 0.0542 3) 0.0562 Stop Targets: 1) 0.0473 🌱 Published By: @Trading_exp🌱

Hashtags

Crypto

@signal_bitcoins · Post #2298 · 12.01.2024 г., 15:07

🔵#GMT price is rising in a Bullish channel on 6H Time frame,we expect it will have another bullish leg from the bottom of this pattern 👀 ❄️@signals_bitcoin_crypto❄️ ❄️@Shadow_support0o❄️

Hashtags

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