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

Резултати

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

Пребарај: #kosovo

当前筛选 #kosovo清除筛选
POPULAR FRONT

@popularxfront · Post #4896 · 04.02.2026 г., 18:18

🇽🇰#Kosovo: Kosovo Police has found yet another cache of weapons, ammunition, and military gear yesterday, after searching the basement of a residential building on Vasilije Ostroški Street in North Mitrovica. Officers recovered multiple assault rifles, hundreds of rounds of ammunition, magazines, a smoke grenade, body armor, and various pieces of military clothing and equipment. No arrests were made, and an investigation into illegal weapons possession is ongoing. This comes as, over the past week, several abandoned weapons caches have been discovered in the north, including one containing hundreds of kilograms of explosives and a practice anti-tank mine. It remains unclear whether the stashes are linked to a specific paramilitary group or a criminal organization. (📸 via @KosovoPolice on FB)

Hashtags

POPULAR FRONT

@popularxfront · Post #4807 · 29.01.2026 г., 19:43

🇽🇰#Kosovo: Kosovo Police have uncovered weapons, ammunition, and explosives in abandoned houses in Zubin Potok, Zvečan, and the North Mitrovica area since the start of this week. Just in North Mitrovica, authorities seized around 140 kg of explosives, which they say were produced in Serbia. The latest seizure was yesterday in Mitrovicë Veri, where police, acting on information from citizens, found several illegal weapons, ammunition, and a VPMA-2 (a practice version of the PMA-2 anti-personnel mine). (📸 via @Kosovo_police on X)

Hashtags

Libertà è ragione

@libertaeragione · Post #3734 · 11.03.2023 г., 13:02

#Kosovo L’Assemblea della Repubblica del Kosovo ha adottato un progetto di legge finalizzato alla regolamentazione giuridica del diritto alla riproduzione sessuale e della procreazione medicalmente assistita. @OsservatorioEsteri

Hashtags

Tutto Elezioni

@tuttoelezioni · Post #1455 · 28.12.2025 г., 18:20

#Kosovo🇽🇰 #Parlamentari 🕖Ore 19:00. Affluenza parziale: 44,29% N.B.: nel computo mancano i seggi speciali, quelli allestiti all'estero e alcune sezioni allestite nel Paese, che non hanno ancora comunicato i dati. @TuttoElezioni

Communia

@communia · Post #37814 · 07.01.2024 г., 09:12

‼️A la chita callando, #España pasa a reconocer la independencia de #Kosovo. Un nuevo giro de 180º de Sánchez alinéandose con #EEUU que impulsa la #guerra https://www.euractiv.com/section/enlargement-neighbourhood/news/kosovo-says-spain-recognises-its-passports/

ПретходнаСтраница 1 од 4Следна