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

Резултати

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

Пребарај: #mrmbb333

当前筛选 #mrmbb333清除筛选
Jeffery Mead

@the_jefferymead · Post #507 · 19.02.2026 г., 05:55

PERFECT RING FORMED OVER LOS ANGELES This appeared high above L.A. just after dusk. A bright linear trail stretched across the sky — and around it, a smooth circular arc expanded and held its shape. The symmetry is what stands out. A straight line through the center. A clean curve wrapping around it. It lingered long enough for people across the city to stop and stare. Los Angeles, California. Did you catch this from where you are? MrMBB333 👇 Drop your city. #MrMBB333#SkyWatch#LosAngeles

🐎 Mustang Debbie Channel🐎

@mustangdebb · Post #47769 · 10.05.2026 г., 00:08

https://x.com/mrmbb333/status/2053139040468418953?s=52 WHILE PEOPLE WERE SLEEPING… EARTH’S FREQUENCY WENT FULL WHITE-OUT AGAIN Overnight, the Schumann Resonance exploded into repeated white-out bursts for more than 5 hours straight. Not one quick spike. Not normal background activity. The chart kept surging, fading, then surging again — staying highly energized deep into the night while most people were asleep. And the amount of white showing across the chart is hard to ignore. Something kept the signal highly charged for hours. Did anyone wake up suddenly last night? • Vivid dreams • Pressure or headaches • Ringing ears • Restless sleep • Electronics acting strange • Pets acting off What are you noticing where you are? #MrMBB333#SchumannResonance#SpaceWeather

Question Everything

@gratefulpatriot · Post #90727 · 20.04.2026 г., 02:17

https://i.fixupx.com/i/status/2045928133946433932 UNKNOWN ACTIVITY SHOWING UP AGAIN IN EARTH’S FREQUENCY For nearly 7 hours, the Schumann Resonance monitor showed sustained saturation across multiple bands. The signal didn’t clear. It stayed compressed across the chart. This isn’t a normal pattern. It follows right behind the last disturbance. Back-to-back activity now. Something is passing through the system. Origin unclear. Monitoring. #MrMBB333#SchumannResonance#SpaceWeather

Question Everything

@gratefulpatriot · Post #90534 · 15.04.2026 г., 20:46

https://x.com/i/status/2044454771378294895 300,000-MILE “GASH” IN THE SUN NOW FACING EARTH Now directly Earth-facing. A coronal hole over 300,000 miles wide is sending high-speed solar wind toward Earth. • Fast solar wind already exiting • Direct alignment in place • Arrival ~36 hours These setups can escalate geomagnetic conditions quickly — and sometimes hold them there. 👇 Watch for: auroras, magnetic disturbances, possible system interference. #MrMBB333#SpaceWeather#SolarWind

🐎 Mustang Debbie Channel🐎

@mustangdebb · Post #48338 · 13.05.2026 г., 00:59

https://x.com/mrmbb333/status/2054322376264057323?s=52 MASSIVE HOLE JUST OPENED IN THE SUN’S ATMOSPHERE A powerful solar eruption has blasted a massive opening through the Sun’s outer atmosphere after an M5.7 flare triggered radio blackout conditions and launched a CME into space. At the same time: • radio blackouts were detected • aurora chances increased • satellites are being monitored closely • solar activity continues intensifying again What has many watching closely is how active the Sun has suddenly become again over the last several months — with multiple eruptions now firing from different regions almost simultaneously. The Sun does not appear to be calming down. Anyone noticing strange skies, signal issues, pressure, vivid dreams, ringing ears, or electronics acting strange lately? #MrMBB333#SpaceWeather#CME

🐎 Mustang Debbie Channel🐎

@mustangdebb · Post #47912 · 10.05.2026 г., 18:56

https://x.com/mrmbb333/status/2053541044068012078?s=52 SOMETHING KEPT HITTING EARTH’S FREQUENCY TODAY ⚡️ The Schumann Resonance has been showing something difficult to ignore. The graph has been cycling through repeated bursts of intense activity, including multiple sustained whiteout periods and powerful 50 Hz pulses lasting close to an hour at a time. This wasn’t a quick spike and fade. The signal kept returning over and over with very little quiet in between. At several points the chart looked completely overwhelmed before briefly calming… only to surge right back again. The level of prolonged saturation showing up today has been unusual. Anyone else feeling like today has felt unusually heavy, restless, intense, or just “off”? Drop your location below. #MrMBB333#SchumannResonance#EarthWatch#SpaceWeather

🐎 Mustang Debbie Channel🐎

@mustangdebb · Post #47677 · 09.05.2026 г., 02:35

https://x.com/mrmbb333/status/2052868548574560425?s=52 🛸 THE UFO DISCLOSURE ISN’T THE BIGGEST STORY Something changed. Not just in Washington… but in the skies. For years people were mocked for talking about strange objects, unexplained lights, military encounters, electrical disturbances, and things that didn’t make sense. Now suddenly… files are being released. Pilots are speaking openly. Major media outlets are covering it nonstop. But here’s what stands out Why is all of this happening at the SAME time the world is seeing: • increased solar activity • strange sky phenomena • drone/satellite concerns • auroras farther south • extreme weather worldwide • nonstop reports coming from the skies Maybe this was never just about UFOs. Maybe something bigger is changing around us… and people are finally starting to notice. 👇 What do YOU think is really going on right now? #MrMBB333#UFO#Disclosure#SpaceWeather#UAP

🐎 Mustang Debbie Channel🐎

@mustangdebb · Post #47916 · 10.05.2026 г., 19:00

https://x.com/mrmbb333/status/2053544993852379307?s=52 THIS WAS THE MOMENT THE SUN ERUPTED New footage captured the exact moment Active Region 4436 unleashed a powerful M5.7 solar flare and blasted a huge CME into space. The eruption came from the same unstable region now rotating across the Earth-facing side of the Sun and scientists are watching closely to see whether part of the plasma cloud is Earth-directed. This clip shows just how violent and fast the eruption actually was. More activity from this region remains possible. #MrMBB333#SolarFlare#SolarStorm#CME#SpaceWeather