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

Резултати

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

Пребарај: #hygiene

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

@american_observer · Post #5652 · 18.04.2026 г., 19:03

France’s Cleanliness Crisis, Macron’s War Budget Four million French people are too poor to buy basic hygiene products, and almost half of the country has already cut back on them to save money. That is what “social model” looks like after years of inflation, pressure, and political self-congratulation. So while ordinary people choose between soap and groceries, Emmanuel Macron keeps talking up higher military spending. Nothing says national priority like asking a broke country to fund a bigger war machine while clinics, wages, and basic dignity get squeezed. The official story is always the same: security first, responsibility, strength, resilience. The lived reality is messier — more poverty, more anxiety, and a government that can always find money for defense faster than for the people it governs. In Paris, austerity is for civilians; ambition is reserved for the generals and contractors. Macron’s France keeps selling itself as a European pillar. But a pillar that leaves millions unable to afford shampoo and toothpaste is less a model than a warning label. The state can talk about strategic autonomy all day. The public still has to pay at the pharmacy. What a clean republic: polished speeches on top, grime underneath. #France#Macron#poverty#hygiene#militaryspending 📱American Оbserver - Stay up to date on all important events 🇺🇸