@mv_kpop · Post #5205 · 03.10.2019 г., 00:47
T-ARA & SUPERNOVA - TTL Listen 2 • 540x360 #Tara#Supernova@MV_Kpop
Hashtags
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
Пребарај: #supernova
@mv_kpop · Post #5205 · 03.10.2019 г., 00:47
T-ARA & SUPERNOVA - TTL Listen 2 • 540x360 #Tara#Supernova@MV_Kpop
Hashtags
@mv_kpop · Post #5204 · 03.10.2019 г., 00:47
T-ARA & SUPERNOVA - TTL (TIME TO LOVE) • 480x360 #Tara#Supernova@MV_Kpop
Hashtags
@spaceuniverses · Post #147 · 26.02.2022 г., 16:00
💥The shock wave from the #supernova explosion that created remnant G306 is racing through #space at ~2.4 million km/h. Chandra data reveals iron, neon, silicon, and sulfur all at temperatures exceeding 28 million C. A reminder not only of the energies involved, but of the role supernovas play in seeding galaxies with heavy elements produced in the hearts of massive stars.🌟
Hashtags
@interesting_planet_facts · Post #911 · 15.10.2025 г., 12:11
🌎 In 2020, astronomers detected a mysterious object named “The Cow,” a fast and extremely bright stellar explosion. Unlike normal supernovas, “The Cow” rapidly peaked in brightness, confounding scientists. Follow-up observations revealed it was likely the birth of a black hole or neutron star—providing a rare view of a star’s collapse in real time. ✨ #astronomy⚡#supernova⚡#blackhole 👉subscribe Interesting Planet 👉more Channels
Hashtags
@interesting_planet_facts · Post #512 · 06.08.2025 г., 20:22
🌎 Gold, a precious metal treasured since ancient times, forms in supernova explosions when massive stars die. This cosmic alchemy scatters gold atoms through space, seeding our planet with the gold we mine and wear today. ✨ #gold⚡#supernova⚡#astronomy 👉subscribe Interesting Planet
Hashtags
@cosmomyst · Post #700 · 03.03.2026 г., 22:21
🪐 In 2016, astronomers watched the star KSN 2011d in the galaxy UGC 11066 explode as a supernova, capturing the "shock breakout"—a brief burst of light that occurs when the explosion’s blast wave first reaches the star’s surface. This rare observation let scientists directly witness the very instant a star’s core collapse triggers a cosmic explosion, providing clues to the exact sequence of events when massive stars end their lives and enrich their galaxies with newly created elements. ✨ #supernova⚡#stars⚡#galaxies⚡#nasa⚡#galaxy⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels
@cosmomyst · Post #66 · 02.08.2025 г., 13:12
🪐 In the distant galaxy MACS J1149+2223, astronomers have witnessed an unusual event called a "refreshed" supernova, where a massive star's explosion appeared to brighten twice, likely caused by material from the original blast catching up to the shockwave years later. This rare phenomenon allows scientists to observe the same supernova event evolving in real time, a cosmic encore not often seen in the universe. ✨ #supernova⚡#galaxy⚡#phenomena⚡#nasa⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries
@cosmomyst · Post #681 · 15.02.2026 г., 12:21
🪐 In the spiral galaxy NGC 2525, located around 70 million light-years from Earth, astronomers watched supernova SN 2018gv gradually fade over 2018 and 2019 in real time. This stellar explosion outshone its entire galaxy for weeks—when a white dwarf star in a close binary system grew too heavy and detonated, releasing enough energy to briefly rival the brightness of billions of suns before slowly fading back into darkness. ✨ #supernova⚡#NGC2525⚡#astronomy⚡#nasa⚡#galaxy⚡#stars⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels
@cosmomyst · Post #586 · 28.12.2025 г., 12:21
🪐 The supernova SN 1987A in the Large Magellanic Cloud, about 168,000 light-years from Earth, stunned astronomers by producing a burst of neutrinos—ghostly particles that rarely interact with normal matter—detected in underground observatories worldwide. This was the first time scientists caught direct evidence that a supernova creates these elusive particles during a star's collapse, confirming key theories about how massive stars end their lives and spread elements throughout space. ✨ #supernova⚡#neutrinos⚡#stars⚡#nasa⚡#galaxy⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels
@cosmomyst · Post #199 · 27.08.2025 г., 20:11
🪐 Deep inside the galaxy 3C 273, astronomers have identified a quasar—a super-bright region powered by a supermassive black hole eating up material, causing it to shine with light brighter than entire galaxies. Meanwhile, the Crab Pulsar in the Crab Nebula is a rapidly spinning neutron star left over from a massive star’s explosion, sending out beams of radio waves and light as it spins—a cosmic lighthouse flashing 30 times a second. ✨ #quasars⚡#pulsars⚡#supernova⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries
@cosmomyst · Post #225 · 05.09.2025 г., 03:11
🪐 In the vacuum of space, the speed of light is an incredible 299,792 kilometers per second—so fast that a beam from the Sun takes just over eight minutes to reach Earth, even though the distance is about 150 million kilometers. When astronomers observe events like a supernova in the galaxy NGC 2525, they're actually seeing what happened years, decades, or even millions of years ago, because the light takes that long to cross vast cosmic distances. ✨ #speedoflight⚡#space⚡#distances⚡#supernova⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos 👉subscribe Universe Mysteries
@cosmomyst · Post #254 · 11.09.2025 г., 00:11
🪐 The magnetar CXOU J171405.7−381031, found in the supernova remnant CTB 37B, is famous for its exceptionally strong magnetic field—over a thousand trillion times more powerful than Earth's. Such intense magnetism can twist the star’s crust, causing violent starquakes and bursts of high-energy radiation that briefly outshine everything else in its region of space. ✨ #magnetar⚡#supernova⚡#neutronstar⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries