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

Пребарај: #scalping

当前筛选 #scalping清除筛选
Daily Channels

@dailychannels · Post #6163 · 27.06.2025 г., 13:00

Channel: GOLD SCALPING TRADING SIGNALS Members: ~4.4K 💢 Username: @gold_scalping_tradings Description: We are the best in Day trading and SCALPING. Contact our admin for your investment and copy trading @Gold_scalping_admin 🏷 Tags: #crypto_fx_trading #gold#forex#trading#scalping#signals https://telegramchannels.me/channels/gold_scalping_tradings

Daily Channels

@dailychannels · Post #6458 · 03.11.2025 г., 13:00

Channel: Robert Croak GOLD SIGNALS Members: ~5.01K 💢 Username: @robertcroakgoldsignals Description: Robert Croak Gold Signals™ – VIP Trading Alerts Get daily premium Gold, Crypto & Forex trading signals with high win rate. Free + VIP alerts | Real-time analysis | 90%+ accuracy Contact me for your investment - @Robert_croaks 🏷 Tags: #crypto_fx_trading #gold#trading#forex#investment#scalping https://telegramchannels.me/channels/robertcroakgoldsignals

Daily Channels

@dailychannels · Post #6135 · 13.06.2025 г., 13:00

Channel: Scalping_300% Members: ~51.42K 💢 Username: @scalping_300 Description: 100% FREE 300% daily profit guarantee With 98% Accuracy 10-30 Signal Daily, Cornix Support. 🏷 Tags: #crypto_fx_trading #scalping#trading#free#cryptocurrency#profit https://telegramchannels.me/channels/scalping_300

Daily Channels

@dailychannels · Post #6425 · 20.10.2025 г., 01:00

Group: Pip Pro Trader Fx Members: ~2.68K 💢 Username: @pip_pro_traderfx Description: Learn Forex trading with real-time signals. Master gold trading, day trading, and scalping with expert strategies and daily motivation. Join our community and start your journey to financial freedom 🏷 Tags: #crypto_fx_trading #forex_trading#day_trading#scalping#forex_signals#gold_signals https://telegramchannels.me/groups/pip_pro_traderfx

🪙$STORM Token: Rising Success in the Market A week after the listing, the $STORM token draws an upward curve on the chart. Let's try to figure out what the growth is connected with and what awaits us in the near future. Let us remind you that Storm Trade— is not just another trading platform, they are pioneers setting trends in the world of decentralized finance, providing a unique trading experience on the largest derivatives #DEX on the #TON network. Roadmap and development of Storm Trade ⚡️Storm Trade V2 Adding new pairs and trading instruments such as commodities ( #crudeoil, #gold etc.) and currencies (#Forex) will open doors to new markets, increasing your ability to diversify your trading strategies. ⚡️ Significant reduction in time to open positions, fixed closing price and guaranteed execution of SL/TP orders will make the trading experience precise and efficient. The next versions of the protocol (V3 and beyond) will feature 1-click trading and gas-free trading. This will make your trading not only efficient but also accessible, lowering entry barriers for beginners. 🏆SocialFi and Copy Trading Trading doesn't have to be boring. With the introduction of copy trading, you will be able to not only trade, but also follow the best traders, copying their successful strategies. Leaderboards of the strongest will encourage traders to compete, achieving better results, and the functions for creating teams (squads) will help find like-minded people and trade together. 🔮Leveraged Prediction Markets Traders will be able to bet on the outcomes of various events, including economic indicators and sports results, with the possibility of using leverage. This will increase potential profits while minimizing investments and will attract the attention of not only cryptocurrency traders, but also those who want to speculate on real events. 📈Options, Spot Trading and Limit Orders The introduction of options will allow users to apply more flexible and advanced strategies. The ability to hed and work with volatility will be an important addition to the main trading instruments, attracting experienced traders. Limit orders will allow traders to use more complex strategies such as #scalping or grid orders, which can be profitable in conditions of high market volatility. #StormTrade will provide users with tools to automate such strategies, making them more efficient. 🪄AI Trading Artificial Intelligence in Action The team began experimenting with the use of artificial intelligence developed by partners to participate in a hackathon, and conducted the first experience of implementing #AI in Storm Trade. The built-in AI proved itself to be effective, helping to find optimal entry and exit points, predict market movements, and minimize risks. The full list of tools planned for implementation can be found here: 🔗Read the article StormTrade | Bot | Chat | Channel