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

Резултати

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

Пребарај: #hairstyle

当前筛选 #hairstyle清除筛选
In Voga | Fashion & Web 3.0

@invogafashion · Post #3259 · 20.10.2022 г., 11:02

We return the heading of simple hairstyles on Thursdays😉 And next, we have a high tail and a couple of braids. If the density of the hair allows, then more than two is possible. #hairstyle

Hashtags

In Voga | Fashion & Web 3.0

@invogafashion · Post #2779 · 02.06.2022 г., 12:37

Today I will tell you one more elementary way to style your hair (and yes, it works even if it is not too clean😉 and even if there is not a lot of time) - a low tail/pigtail. There is only one rule - we "hook" the hair as low as possible at the neck, and then - whoever is in what much: - pigtail - leave fluffy and straight, and cover the elastic with a strand of hair - rewind with laces -leave fluffy and add some waves - artificial chaos - add bows and ribbons Inspiration attached👆🏼 #hairstyle

Hashtags

In Voga | Fashion & Web 3.0

@invogafashion · Post #2745 · 28.05.2022 г., 12:11

Hairpins everywhere, hairpins in large quantities, hairpins of various types and types, hairpins in any way - this summer, we are experimenting with hairpins, and we are not afraid to overdo it 😉 A few ideas above👆🏼😉 #hairstyle

Hashtags

In Voga | Fashion & Web 3.0

@invogafashion · Post #2673 · 19.05.2022 г., 13:04

If you suddenly decide to impress everyone with your hair, I suggest taking a incredible work by Mitsuki Jurk as a reference. Hollywood wave with pigtails, asymmetric tails, and braids, geometric parting, a mix of different types of braids, braids + natural flowers🌸🌼🌺🌹🌷 When the head and hair are like a picture 🖼, and the hairdresser is like an artist 👩‍🎨 #hairstyle

Hashtags

In Voga | Fashion & Web 3.0

@invogafashion · Post #849 · 16.08.2021 г., 12:02

One of my good friends cut her hair yesterday, and when I saw her, I thought - to the wolf regiment of thousands of TikTok and Instagram bloggers 🐺 has been added another one. And today, a little about this trend. Wolfcut🧑🏻‍🦰 is the most fashionable haircut for summer 2021 that came to us from Korea. Strictly speaking, this is a mixture of 2 haircuts: mullet and shaggy. With wolf cut, the hair is cut in layers from the crown, and bangs are made (these are shaggy features), but at the back of the head, the hair is left long (borrowed from mallet) - it turns out like wool from wolves, which is slightly longer at the withers. Suitable - thin, but thick enough hair, on too thin hair it is necessary to achieve volume is difficult, and as a result, a completely different story turns out. The strands are stacked from the face. The general appearance of the hairstyle is always disheveled and a little messy. #hairstyle

Hashtags

In Voga | Fashion & Web 3.0

@invogafashion · Post #741 · 27.07.2021 г., 13:06

And here are some more examples on the topic of the previous hairstyle for the summer: - pigtails can be slightly perceptible and have very weak weaving, -can be located not only nearby the face but also a little further along with the top layer of the hairstyle, -and you can braid them, as in the first photo, but the truth is then such a hairstyle cannot be called fast and easy😂 Happy experiments! 😉 #hairstyle

Hashtags

In Voga | Fashion & Web 3.0

@invogafashion · Post #740 · 27.07.2021 г., 11:33

Leonie Hanne reminds us that summer☀️ is the perfect time for fine braids nearby our beautiful eyes: ✔️ it is comfortable and hair does not get into the eyes👍🏼 ✔️ conceptually and summerly ✔️ relevant in summer 2021👌🏼 #hairstyle

Hashtags

In Voga | Fashion & Web 3.0

@invogafashion · Post #1704 · 04.01.2022 г., 12:32

It seems absolutely all influencers are obsessed with headbands😍 The undisputed leaders among brands are Prada, Fendi, Simone Rocha, but the rest are quickly catching up. Unambiguously like from me👍🏼 Today there is a new street style. Let's inspire ❤️ #inspirationINVOGA #hairstyle

ПретходнаСтраница 1 од 3Следна