@internationalgeographic · Post #5892 · 20.08.2025 г., 15:18
Folegandros Island, #Greece🇬🇷 This tiny paradise offers secluded turquoise bays, delicious seafood, and a beautiful view from the Panagia church on top of the hill.
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
Пребарај: #greece
@internationalgeographic · Post #5892 · 20.08.2025 г., 15:18
Folegandros Island, #Greece🇬🇷 This tiny paradise offers secluded turquoise bays, delicious seafood, and a beautiful view from the Panagia church on top of the hill.
Hashtags
@internationalgeographic · Post #5776 · 25.06.2025 г., 08:57
Corfu, #Greece🇬🇷 Corfu (also known as Kerkyra) is the northernmost and second-largest of the Greek Ionian Islands. The Greeks themselves use the name Kerkyra. Corfu is a very green and picturesque island. Many tourists find the atmosphere of Corfu to be more Italian than Greek, and there is a reason for this: for 400 years, this landmass in the Ionian Sea belonged to Venice. Here, you will find turquoise bays, luxurious beaches, diverse architecture, and ancient temples.
Hashtags
@internationalgeographic · Post #5701 · 21.05.2025 г., 12:54
Megara, #Greece Wow, that's great, it's an interesting attraction. A railway bike is a unique and exciting way to explore the stunning landscapes of Greece.
Hashtags
@internationalgeographic · Post #5675 · 14.05.2025 г., 14:05
Symi Island, #Greece There is no airport here, so you will be met by boat in a neoclassical harbor with pastel-colored buildings. The island of Simi is famous for the extraction of sea sponges.
Hashtags
@artematizando · Post #4519 · 26.07.2023 г., 10:09
Holy Trinity, Kastoriay #Greece
Hashtags
@militantwire · Post #2311 · 19.07.2022 г., 00:00
Militant Wire’s Tom Lord: I just wrote a piece on the killing of Thanos Axarlian, 30 years ago, during a 17N assassination attempt on the finance minister of #Greece. "Remembering 17N's Assassination Attempt on Finance Minister Ioannis Palaiokrassas, July 1992" by @PotempkinBrain https://twitter.com/potempkinbrain/status/1548821545174257664?s=21&t=lWm80Fg8DDtUzXgLKt-nZw
Hashtags
@militantwire · Post #2166 · 14.06.2022 г., 01:20
🇬🇷🏴#Greece: Anarchist and alleged member of the Conspiracy Cells of Fire, Yannis Michailidis (aka "The Syntagma Archer"), has been taken to hospital on the 21st day of his hunger strike in prison. He has apparently lost more than 10% of his intial body weight: https://twitter.com/potempkinbrain/status/1536475186282872833?s=21&t=Tdg9UGvGARRa9FjQOyGpPA
Hashtags
@VOYAGE · Post #1660 · 31.01.2026 г., 13:14
Greece🇬🇷 Astypalea Island, a gem of the Dodecanese, lies in the southeastern Aegean. Its remote location has preserved authentic culture and traditions. On a central hill sits Chora, the historic capital, offering panoramic views of the endless Aegean Sea, crowned by the Venetian-era Querini Castle. 🏰🌊 #Greece | @voyage
Hashtags
@VOYAGE · Post #1625 · 13.12.2025 г., 13:14
Greece🇬🇷 Astypalea Island, a gem of the Dodecanese, lies in the southeastern Aegean. Its remote location has preserved authentic culture and traditions. On a central hill sits Chora, the historic capital, offering panoramic views of the endless Aegean Sea, crowned by the Venetian-era Querini Castle. 🏰🌊 #Greece | @voyage
Hashtags
@VOYAGE · Post #1380 · 05.04.2025 г., 12:14
😍 Sarakiniko Beach is widely considered the most beautiful beach on Milos Island. 📏 📏 📏 📏 📏 📏 📏 📏 #Greece🇬🇷@voyage
Hashtags
@VOYAGE · Post #1077 · 30.08.2024 г., 12:14
🗺Greece 🇬🇷 Corfu Island has long been celebrated as one of the most charming spots in Greece. It captivates with its beauty from the very first glance. Looking at the island from an airplane window, you'll be amazed by its extraordinary emerald color. #Greece @voyage
Hashtags
@VOYAGE · Post #1066 · 20.08.2024 г., 12:14
🗺Greece🇬🇷 A gentle pink sunset at a luxurious resort on the island of Mykonos #Greece @voyage
Hashtags