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

Резултати

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

Пребарај: #datacenter

当前筛选 #datacenter清除筛选
producTICvidad® 📲📈

@producTICvidad · Post #847 · 16.07.2022 г., 19:55

¿Quieres conocer un #datacenter por dentro? No te pierdas este fabuloso tour virtual en 3D por uno de los centro de datos de Microsoft 👨🏽‍💻 https://news.microsoft.com/stories/microsoft-datacenter-tour/ Comparte 🔁este canal para que muchas personas también tengan acceso a esta información privilegida💚 La productividad esá en tiC 📲📈

Hashtags

The Telegram Times

@TheTGTimes · Post #439 · 29.12.2024 г., 18:58

📰DC1 is unstable We aregetting reports that telegram’s datacenter in Pluto, Miami - DC1 is experiencing some issues since a few minutes ago. The app is displaying “Updating…” at the top of the chat list, but there is no problem sending or receiving messages. This issue has only been reported for DC1. UPDATE: Issue fixed (19:04 UTC) #datacenter 👉The TG Times

Hashtags

The Telegram Times

@TheTGTimes · Post #329 · 13.04.2024 г., 20:47

📰Telegram is unstable Minutes ago, the status of all Telegram datacenter has become unstable. Its exact cause is still unknown #DataCenter 👉The TG Times

Hashtags

MikroTik.SG

@mikrotiksg · Post #329 · 18.12.2025 г., 08:04

🚀 400G Networking Made Practical Meet the MikroTik CRS804-4DDQ-hRM — a compact 400 Gigabit switch designed for AI clusters, storage fabrics, and next-generation core networks. ✅ 4× 400G QSFP-DD (breakout supported) ✅ Dual hot-swap power supplies ✅ RouterOS v7 – no subscriptions ✅ Compact & energy-efficient Enterprise speed without enterprise pricing. #MikroTik#400G#Datacenter#AI#Networking

Machinelearning

@ai_machinelearning_big_data · Post #9291 · 22.12.2025 г., 08:40

⚡️Это гигантский дата-центр Amazon за $11 млрд в Индиане. Кампус строится под обучение и инференс ИИ и будет потреблять до 2.2 ГВт - примерно как 1 миллион домов. В состав комплекса войдут собственные электростанции, поэтому нагрузка на местную энергосеть и тарифы для жителей должна быть минимальной. @ai_machinelearning_big_data #Amazon#DataCenter#AIInfrastructure#AIFactory#CloudComputing

Crypto M - Crypto News

@CryptoM · Post #64708 · 09.04.2026 г., 15:25

🚀 Amazon Plans $25 Billion Data Center Investment in Mississippi Amazon has announced plans to invest $25 billion in building a data center in Mississippi. According to Odaily, this significant investment is expected to create 2,000 jobs in the region. The initiative marks a substantial economic development for the state, promising to boost local employment and infrastructure. #Amazon#DataCenter#Mississippi#Investment#Jobs#EconomicDevelopment#Infrastructure

Venture Village Wall 🦄

@venturevillagewall · Post #3549 · 20.12.2024 г., 09:32

OptiCore Raises $5M for AI Chips OptiCore has secured $5M in funding to enhance its photonic chips, promising 100x energy efficiency and computing density for AI applications. This innovation aims to transform high-performance data center computing. #OptiCore#Funding#AI#Chips#DataCenter#Efficiency#Photonics#Computing#Revolution#Performance

Crypto M - Crypto News

@CryptoM · Post #64944 · 10.04.2026 г., 11:49

🚀 AI TRENDS | Anthropic Secures CoreWeave Data Center Capacity Amid Rising AI Demand Anthropic has agreed to lease data center capacity from CoreWeave to address the growing demand for its AI services, Jin10 reports. CoreWeave announced on Friday that the multi-year agreement will assist Anthropic in building and deploying its Claude AI model. CoreWeave's CEO, Intrator, stated that the deal will involve various Nvidia chip architectures within U.S. data centers. The financial terms of the agreement were not disclosed by either company. Anthropic, similar to OpenAI, has been at the forefront of the AI service surge, sometimes struggling to maintain its products online due to what it describes as 'unprecedented demand.' Earlier this week, Anthropic revealed a collaboration with Broadcom and Google to secure 3.5 gigawatts of energy, noting that one gigawatt of power is sufficient to supply electricity to approximately 750,000 U.S. households simultaneously. #AI#Anthropic#CoreWeave#DataCenter#ClaudeAI#Nvidia#Broadcom#Google#ArtificialIntelligence#TechTrends

Crypto M - Crypto News

@CryptoM · Post #65020 · 10.04.2026 г., 14:09

🚀 AI TRENDS | CoreWeave's Junk Bonds Rise Amid Optimism from Tech Deals CoreWeave's junk bonds experienced a rise in value due to increased market optimism following transactions with several major technology companies. According to Jin10, as of 9:05 AM New York time (21:05 UTC+8), the bonds, which have a coupon rate of 9.75% and a face value of 100 cents, increased to 101.88 cents. During the syndication process, the bond's size was expanded from the initially planned $1.25 billion. Data shows that another convertible bond issued on the same day, which was also increased to $3.5 billion, has yet to begin trading. This financing round is the latest for CoreWeave and occurred just hours after the company announced a new agreement with Meta Platforms to supply AI computing products. On Friday, Anthropic agreed to lease CoreWeave's data center capacity to meet the growing demand for its AI services. CoreWeave's stock rose more than 6% during intraday trading. #AI#CoreWeave#JunkBonds#TechDeals#Financing#Meta#Anthropic#DataCenter#StockMarket#ConvertibleBonds