Теперь запакуем строку.
В этом случае следует передавать тип данных bytes.
>>> struct.pack('=s', b'a')
b'a'
Для записи слова следует указывать количество символов.
>>> struct.pack('=5s', b'hello')
b'hello'
Кстати, запакованный вид соответствует исходному тексту. Всё верно, символ есть в таблице ASCII, то есть его код попадает в диапазон 0-127, он может быть записан одним байтом и имеет визуальное представление. А вот что будет если добавить символ вне ASCII
>>> struct.pack(f'=s', b'ё')
SyntaxError: bytes can only contain ASCII literal characters.
Ошибка возникла еще на этапе создания объекта bytes, который не может содержать такой символ. Поэтому надо кодировать эти байты из строки.
>>> enc = 'ёжик'.encode('utf-8')
>>> struct.pack(f'={len(enc)}s', enc)
b'\xd1\x91\xd0\xb6\xd0\xb8\xd0\xba'
Заметьте, длина такой строки в байтах отличается от исходной длины, так как символы вне ASCII записываются двумя байтами и более. Поэтому здесь формат создаём на лету, используя получившуюся длину как каунтер токена.
#libs#basic
👋Всем привет!
• Рассвирепеть (perf.)
[ra-svi-ri-pet']
To become very angry, furious, enraged
🔻It is often used to describe the behaviour of animals, but it can also be used to describe people.
🔻The verb comes from the Russian adjective свирепый [svi-re-pyj] furious, enraged.
🔻The prefix РАС- means 'to become' or 'to start to'.
Synonym:
• Озвереть
[az-vi-ret']
To become bestial
• Котейка рассвирепел и напал на человека.
[ka-tey-ka ra-svi-ri-pel i na-pal na chi-la-ve-ka]
The kitten became enraged and attacked the human.
🎧🗣👇
#useful_vocabulary
#prefixes
😎RCRussian | Support | Boost
👋Приветствую, товарищи!
• Зализывать раны (после + Genintive) (imperf.)
[za-li-zy-vat' ra-ny (pos-le)]
=
• Зализать раны (perf.)
[za-li-zat' ra-ny]
SLT: To lick one's wounds (after..)
🔻Despite its literal translation, this Russian idiom doesn't refer to physical injuries. Instead, it describes the process of recovering from a defeat, setback, offense, or other negative event. It's about emotional and mental healing, taking time to recover strength and composure after a difficult experience.
🔻The prefix за- in the verb зализывать implies the completion of an action, bringing it to an end or a result. In this case, it signifies complete recovery.
Example (resemblance to actual political events is purely coincidental!!):
• После схватки кот и собака зализывали раны, понимая, что хрупкий мир может рухнуть в любой момент.
After their scuffle, the cat and dog licked their wounds, aware that their fragile peace could collapse at any moment.
🎧🗣👇
▶️Как кошка с собакой
#phraseology
#prefixes
😎RCR | Support | Boost
Догрызу завтра.
I'll finish gnawing it tomorrow.
• Грызть (imperf.)
[gryst']
To gnaw
• Сгрызть (perf.)
[zgryzt']
To gnaw off / to gnaw completely
• ДОгрызть (perf.)
[da-gryst')
To finish gnawing
• ПЕРЕгрызть (perf.)
[pi-ri-gryst']
To gnaw through
💢But colloquial:
• Грызться = ругаться (imperf.)
[ry-st'sya = ru-ga-t'sya]
To squabble, to bicker (not about gnawing!)
🖼It still works without VPN!!!
#verbs
#prefixes
#useful_vocabulary
🟠RCR | Support | Boost
Всё! Хватит! Я нагулялся!
Alright, that's enough! I've walked enough
• НАгулятьСЯ (perf.)
[na-goo-lya-tsa]
To walk/be out enough so that the desire or need for it is completely fulfilled
🔻In the reflexive verb нагуляться, the prefix НА- carries a core idea of doing an action to the point of full satisfaction, completion, or even excess. It implies reaching a personal limit or a sense of enough.
#useful_vocabulary
#prefixes
#verbs
🟠RCR | Support | Boost
👋Приветствую!
• ПЕРЕзарядить батарейки (perf.)
[pi-ri-za-ri-dit' ba-ta-rey-ki]
Meanings:
🔢Literally: to recharge a device's battery
🔢Figuratively: to rest and rejuvenate oneself, to regain energy and motivation after a period of exhaustion or stress
🔻Prefix ПЕРЕ- means REdo something/ do something again:
• ПЕРЕписать = to REwrite
• ПЕРЕчитать = to REread
• Устали? Время перезарядить батарейки!
Got tired? It's time to recharge batteries!
▶️Other meanings of prefix ПЕРЕ-
🎧🗣👇
#useful_vocabulary
#prefixes
#grammar_tips
😎RCRussian | Support | Boost
• Зажраться (perf.)
[za-zhra-tsa]
🔸Conjugation
🔻This slang verb means to pig out,to become insufferably spoiled, arrogant, or fussy due to excessive food, comfort, wealth, or success.
🔻The prefix ЗА- in this verb indicates the beginning and completion of a process leading to a negative, excessive state.
• Жрать (vulgar: to eat/devour) metaphorically suggests greedily consuming comforts.
• ЗАжраться = to have gone too far in that consumption and to have become stuck in the resulting bad state (arrogance, spoiled behaviour).
🔻Think of the prefix ЗА- as marking the point of crossing over into a negative condition (and staying there):
• Зазнаться (perf.)
[za-zna-tsa]
To become conceited
• Зазвездиться (slang, perf.)
[za-zviz-di-tsa]
To get a big head from fame
Наш кот совсем зажрался!
Our cat is living the high life! = Our cat has it too good! = Our cat has become totally spoiled!
#prefixes
#spoken_Russian
#verbs
🟠RCR | Support | Boost
I do hope you've been missing cats here😉!
• Гулять (imperf.)
[goo-lyat']
To walk, to stroll, or to be out and about
😉 But what if we add preffix НА- to the verb?
• НAгулять + Noun (usually weight, appetite)
To gain something as a result of walking:
• Нагулять аппетит (perf.)
[na-goo-lyat' a-pe-tit]
To work up an appetite
#useful_vocabulary
#just_cats
#prefixes
#verbs
🟠RCR | Support | Boost
Он всё ПЕРЕсчитал, один кусочек оказался лишним.😅
He counted everything, and there was one piece extra.
❓️What are useful prefixes with считать (to count)?
1. Считать (imperf.)
[shchi-tat']
To count, to consider, to believe
2. ПОсчитать (perf.)
[pa-shchi-tat']
To count, to calculate, to do the math
🔻Prefix ПО- indicates completion of an action.
3. ПОДсчитать (perf.)
[pat-shchi-tat']
Тo sum up, to calculate (focusing on the final result or subtotal)
🔻Рrefix ПОД- means adding up or tallying - as if gathering everything under a total.
4. ПЕРЕсчитать (perf.)
[pe-ri-shchi-tat']
Тo recount, to count again
🔻Prefix ПЕРЕ- means re- (again).
#prefixes
#verbs
#grammar_tips
🟠RCR | Support | Boost
👋Приветствую, товарищи!
It's gloomy, cold and rainy in my city today ... Hope your summer is way better than mine😔.
• (Не) Выспаться (perf.)
[ni vys-pa-tsa]
(Not) to get enough sleep
🔻The verb выспаться comes from the verb спать (to sleep).
🔻The prefix ВЫ- here signifies completeness, the conclusion of an action, and a sufficient degree/extent.
🔻The perfective aspect verb выспаться doesn't have the Present Tense forms, so, you can use its imperfective equivalent:
• Высыпаться (imperf.)
[vy-sy-pa-tsa]
❗️Don't confuse высыпаться (to have enough sleep, imperf.) and высыпаться (to pour out, spill out, be scattered, perf.).
The Past tense:
• Я не выспался (masc.,singular)
[ya ni vys-pal-sya]
=
• Я не выспалась (femin.,singular)
[ya ni vys-pa-las']
=
• Мы не выспались (plural)
[my ni vys-pa-lis']
I / we haven't had enough sleep
❓️А вы выспались сегодня?
❤️ if you find this post useful!
#useful_vocabulary
#grammar_tips
#prefixes
#tricky_words
😎RCR | Support | Boost
Только не пересоли!
Just don't oversalt it!
• Пересолить (perf.)
[pi-ri-sa-lit']
😄Conjugation
🔻The prefix ПЕРЕ- added to the verb солить (to salt) creates the verb пересолить, which means to add too much salt, to make something excessively salty.
🔻Other examples with ПЕРЕ-:
• ПЕРЕстараться (perf.)
To overdo/try too hard
• ПЕРЕгрузить (perf.)
To overload
• ПЕРЕплатить
To overpay
▶️Переборщить
#verbs
#prefixes
#learn_russian
😎RCR | Support | Boost
🫥Закружиться (perf.)
[za-kru-zhy-tsa]
😄Conjugation
🔻This verb is derived from the verb кружить (to make something spin) with the reflexive suffix -ся and the prefix за- (it indicates the beginning of an action).
Meanings:
1) To start spinning, whirling: It describes the beginning of a rotational movement. Also about feeling dizzy:
• У меня закружилась голова.
I'm feeling dizzy.
2) To get caught up in the whirlwind of work, to be swamped/spun around by work:
• Извините, что не звонила, я просто закружилась на работе.
Sorry I didn't call, I just got swamped at work.
▶️Крутиться как белка в колесе
#verbs
#prefixes
#spoken_russian
#learn_russian
😎RCR | Support | Boost
Матерь котья! Бесконечный лоток!
Holy Cat Mother! Endless litter box!
• Бесконечный (masc.adj.)
[bis-ka-nech-nyj]
Synonyms (masc.adj.):
• Безграничный
[biz-gra-nich-nyj]
Boundless, limitless, infinite, unbounded
• Нескончаемый
[nis-kan-cha-yi-myj]
Endless, unending, interminable, incessant
• Непрерывный
[ni-pri-ryv-nyj]
Continuous, uninterrupted, unbroken, constant
❗️Note that the prefixes БЕС- and БЕЗ- mean the absence of something, and their choice depends on the following letter:
🔻if it's a vowel or a letter representing a voiced consonant, use БЕЗ-;
🔻if it's a voiceless consonant, a sibilant, or ц, use БЕС-.
🔻Don't forget to ->❤️ this post, please!
🎧🗣👇Всем нескончаемой субботы😉!
#useful_vocabulary
#adjectives
#synonyms
#prefixes
😎RCR | Support | Boost