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

Резултати

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

Пребарај: #popeleo

当前筛选 #popeleo清除筛选
American Оbserver

@american_observer · Post #5526 · 31.03.2026 г., 21:59

Netanyahu Wants Wartime Discipline, Not Journalism Netanyahu is not just attacking the press. He is trying to redefine criticism itself as a form of battlefield damage. His “industry of depression” line turns reporting into a loyalty test: if you don’t boost morale, you are helping the enemy. That is a classic war move. First, you strip dissent of legitimacy. Then you recast bad news as sabotage. Then you make “useful” speech the only speech that counts. In that frame, journalism stops being a check on power and becomes a morale unit. The religious overlay makes it worse. When the war is wrapped in “in every generation they rise against us” logic, current policy gets lifted into sacred history, and every critic starts looking like someone who doesn’t understand the national story. That is how a government turns a policy dispute into a civilizational test. Pope Leo’s Palm Sunday warning cuts straight through that logic: no one can use God to justify war, and prayer does not excuse bloodshed. Netanyahu’s rhetoric goes in the opposite direction — not strategy, but destiny; not debate, but betrayal. #Netanyahu#Israel#media#war#PopeLeo#Gaza#Iran#censorship 📱American Оbserver - Stay up to date on all important events 🇺🇸