TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

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

Hashtags

Резултати

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

Пребарај: #miga

当前筛选 #miga清除筛选
Kayleigh McEnany

@kayleighmcenany · Post #2720 · 23.06.2025 г., 14:22

White House: If the Iranian regime refuses to come to a peaceful, diplomatic solution — which the President is still interested in engaging in ... why shouldn't the Iranian people take away the power of this incredibly violent regime? #MIGA @KayleighMcEnany

Hashtags

Kayleigh McEnany

@kayleighmcenany · Post #2729 · 24.06.2025 г., 10:02

From an Iranian to the USA and Israel: The Islamic Republic ain’t gonna make peace—remember that. Araghchi is the regime’s lapdog, and there’s no difference between reformists and hardliners. It was the reformists that imposed the hijab in the beginning of the revolution, it was the reformist government who killed more than 5000 people in just 3 days during "Aban 98" protest. Did you see how, right after the peace announcement, they struck again—and so far six people in Beer Sheba have lost their lives? And launched another missiles after ceasefire? While they are denying these officially they are celebrating about it online and in their circles. This regime is wounded and insane; it’s handing out mass death sentences to people in Iran under the name of “espionage,” and it’s even threatening us abroad that “soon we’ll be wiped out.” Their soilders and loyalists are now in the streets of Tehran and big cities going through people's phone to arrest people who have any messages, pictures and videos in support of Trump, USA and Israel or anti regime. How do you expect to make peace with this regime?! They only understand the language of force; they’ve never played by the rules of humanity, negotiation, or law. Those still talking about dialogue are either in on the power themselves or are fooling themselves. We’re not up against a normal system—we’re facing a mafia that treats people’s lives as worthless. Peace only makes sense when both sides choose life, not when one side is solely after suppression, power, and the physical elimination of its opponents. The Islamic Republic is seeking neither peace with its own people nor with the world. The only thing it understands is resistance and cost. Real peace can only be made with the people of Iran, not with a regime that has declared war on its own people for years. Please share this message and be our vioce. #Trump#Israel#USA#Iran#War#MAGA#MIGA#Peace#Regime @KayleighMcEnany