@Learn_English_from_Zero_to_Hero · Post #60680 · 31.03.2026 г., 18:01
#Expressions
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #183 · 23 ное.
Python + bash Если вам часто требуется запускать shell команды из Python-кода, какой способ вы используете? Самый низкоуровневый это функция os.system(), либо os.popen(). Рекомендованный способ это subprocess.call(). Но это всё еще достаточно неудобно. Советую обратить своё внимание на очень крутую библиотеку sh. Что она умеет? 🔸 удобный синтаксис вызова команд как функций # os import os os.system("tar cvf demo.tar ~/") # subprocess import subprocess subprocess.call(['tar', 'cvf', 'demo.tar', '~/']) # sh import sh sh.tar('cvf', 'demo.tar', "~/") 🔸 простое создание функции-алиаса для длинной команды fn = sh.lsof.bake('-i', '-P', '-n') output = sh.grep(fn(), 'LISTEN') в этом примере также задействован пайпинг 🔸 удобный вызов команд от sudo with sh.contrib.sudo: print(ls("/root")) Такой запрос спросит пароль. Чтобы это работало нужно соответствующим способом настроить юзера. А вот вариант с вводом пароля через код. password = "secret" sudo = sh.sudo.bake("-S", _in=password+"\n") print(sudo.ls("/root")) Это не все фишки. Больше интересных примеров смотрите в документации. Специально для Windows💀 юзеров #libs#linux
Пребарај: #expressions
@Learn_English_from_Zero_to_Hero · Post #60680 · 31.03.2026 г., 18:01
#Expressions
Hashtags
@Learn_English_from_Zero_to_Hero · Post #60602 · 26.01.2026 г., 16:56
#Expressions 💥Throw sb off 'course : 🔅if sb/sth is thrown off course, they are forced away from the direction they should be travelling in: ▪️ The plane was thrown off course. 2🔅to force sb to change the direction in which their ideas or actions are moving: ▪️ The government was thrown off course by economic problems.
Hashtags
@Learn_English_from_Zero_to_Hero · Post #60131 · 23.08.2025 г., 18:19
#Expressions 💥Fly the coop. ▪️ (idiomatic) Leave or escape. 💥Once she heard the teacher's voice, she flew the coop .
Hashtags
@Learn_English_from_Zero_to_Hero · Post #60129 · 23.08.2025 г., 18:14
#Expressions 💥Doom and gloom (uncountable) ▪️Something considered indicative of feelings of pessimism and despair. ▪️Antonyms: rainbows and unicorns, sunshine and rainbows. ⚡️The economic forecast contained the usual doom and gloom. ⚡️His sister was all doom and gloom after she lost the part.
Hashtags
@Learn_English_from_Zero_to_Hero · Post #60128 · 23.08.2025 г., 18:12
#Expressions 💥No great shakes (uncountable) ▪️(idiomatic) Something unexceptional, not noteworthy or special. ▪️Synonyms: nothing to write home about ⚡️You're welcome to stay here, but this hut ain't no great shakes for such as you.
Hashtags
@Learn_English_from_Zero_to_Hero · Post #59967 · 30.07.2025 г., 19:01
#Expressions 💥raring to do something (BrE) ● very eager to do something ⚜The children were raring to get outdoors.
Hashtags
@Learn_English_from_Zero_to_Hero · Post #59966 · 30.07.2025 г., 19:01
#Expressions 💥on the brink ●(idiomatic) Very nearly; imminent; close. ⚜The old building seemed to be on the brink of collapse.
Hashtags
@Learn_English_from_Zero_to_Hero · Post #59965 · 30.07.2025 г., 19:01
#Expressions 🔘on the level ▪️(idiomatic) Honest(ly), sincere(ly), straightforward(ly), fair(ly). 🔸He looks like a used car salesman, but he's really on thelevel, so you can trust him.
Hashtags
@Learn_English_from_Zero_to_Hero · Post #59936 · 24.07.2025 г., 19:00
#Expressions 💥Finer things ●That which is considered of a high quality, expensive or tasteful. •Example: ⚡️I'm not materialistic, though I do enjoy the finer things in life.
Hashtags
@Learn_English_from_Zero_to_Hero · Post #59935 · 24.07.2025 г., 19:00
#Expressions 💥Lose sleep over something •to worry about something •Example: ⚡️I know she's angry with me, but I'm not losing any sleep over it.
Hashtags
@Learn_English_from_Zero_to_Hero · Post #59934 · 24.07.2025 г., 19:00
#Expressions 💥Take the plunge •to do something important or difficult, especially after thinking about it for a long time. ●Example: ⚡️We're finally going to take the plunge and buy a house.
Hashtags
@Learn_English_from_Zero_to_Hero · Post #59909 · 23.07.2025 г., 06:16
#Expressions 💥Lend itself to sth FORMAL •to be suitable for a particular purpose •Example: ⚡️The novel's complex, imaginative style does not lend itself to translation.
Hashtags