AVOID Backslash HELL With R-Strings In Python 💡

preview_player
Показать описание
Avoid backslash hell with r-strings in #Python. #Code #Shorts
Рекомендации по теме
Комментарии
Автор

Python Slowly,
Let me introduce you to a-strings, b-strings, c-strings, d-strings, e-strings, g-strings, h-strings, i-strings, j-strings, k-strings, l-strings, m-strings, n-strings, o-strings, p-strings, q-strings, s-strings, t-strings, u-strings, v-strings, w-strings, x-strings, y-strings, and z-strings.

BytesVsStrings
Автор

When using regex is it best to use raw strings?

moahmadi
Автор

Heck yeah! Escaping all that slashes would have been a nightmare without RAW strings (AKA r-strings) 😅
Thanks for the explanation 🍉😉👍!

dcknature
Автор

You also have u-string for Unicode characters in python 2, they still exist in python 3 but they're obselete as all string are Unicode by default.

Migoyan
Автор

a = r"hello" + "\nhii" 😂😂😂

wasimshaikh
Автор

Is there a way to convert literal strings to normal strings?
Like if I use an input and get something with \n in it and I want it to be stored as a new line rather than the \n

ToxicBananaFish
Автор

what IDE are you using? thanks for the tips

quetzalcoaltjp
Автор

How do I use a r-string on a f-string?

knut-olaihelgesen
Автор

Pretty sure the mistake is using backslash for path names both Unix and windows accept forward slash for file names that shouldn’t need escaping

synderis
Автор

What about path = r'C:\Users\User\Desktop\'

omegastripes
Автор

Can’t you put them together aswell? fr

oSpam
Автор

or do the same things with triple quotation marks

claymore