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 слични објави

Пребарај: #moyale

当前筛选 #moyale清除筛选
Addis Standard

@addisstandardeng · Post #21544 · 27.02.2026 г., 09:03

#Kenya arrests suspect in duping men to fight for #Russia in Ukraine war Police in Kenya have arrested a man accused of being a member of a human trafficking scheme that lured Kenyans to Russia with false promises of work, only for them to end up fighting on the front lines of #Ukrainian battlefields. In a statement released late on Wednesday, Kenyan officials said Festus Arasa Omwamba was being detained in #Moyale, a town in the country’s north bordering Ethiopia. The 33-year-old “is believed to be a key player in a more extensive human trafficking syndicate that exploits vulnerable individuals by promising them legitimate employment opportunities in European ..... https://www.aljazeera.com/news/2026/2/26/kenya-arrests-suspect-in-duping-men-to-fight-for-russia-in-ukraine-war?utm_source=facebook&utm_medium=social&utm_campaign=socialPulse&fbclid=IwY2xjawQOIs1leHRuA2FlbQIxMABzcnRjBmFwcF9pZBAyMjIwMzkxNzg4MjAwODkyAAEer7RCtq5Hcs-58ZNC1n8bjMgzBEQnikgUQ2KCBjmATIbmYbZzYsXcXNQEuBw_aem_c1xi54oPymFMwGZjtjqgPg

Addis Standard

@addisstandardeng · Post #21605 · 04.03.2026 г., 08:32

News: #Ethiopia, #Kenya agree to launch joint military operations to secure border corridor, #LAPSSET Ethiopia and Kenya have agreed to strengthen security coordination along the #Moyale–#Marsabit–#Turkana corridor, endorsing structured joint military operations aimed at addressing cross-border threats and safeguarding key infrastructure linking the two countries. The agreement is part of renewed efforts to operationalise the existing Defence Cooperation Agreement (#DCA) between the two neighbours. Under the arrangement, the Ethiopian National Defence Force (#ENDF) and the Kenya Defence Forces (#KDF) are expected to undertake phased and coordinated operations targeting vulnerable border areas and strategic assets. In a related development, Ethiopia’s defence ministry also held bilateral talks with a delegation from the #Rwanda Defence Force (#RDF) on the margins of the Adwa anniversary celebrations. According to RDF, discussions focused on deepening.... Read more: https://addisstandard.com/?p=55528