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

Резултати

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

Пребарај: #terny

当前筛选 #terny清除筛选
DruschbaFM - English

@druschbaFm_en · Post #52058 · 14.03.2025 г., 08:04

⚡️🇷🇺🇺🇦⚡️ Two Majors #Summary for the Morning of 14 March 2025; 07:00 (GMT+3)⚡️ 🛡 The Enemy attacked an oil complex in #Tuapse using drones overnight. One of the fuel storage tanks caught fire, with the blaze covering an area of over 1,000 square metres. Emergency services are on-site. Additionally, drones were shot down over the #Saratov and #Voronezh regions. 🔹 In #Kursk Region, the 'Group of Troops North' liberated #Zaoleshenka and the settlement of #Goncharovka, clearing the outskirts of #Sudzha from all sides. The enemy continues to strike the liberated areas, trying to inflict maximum damage on our forces. Footage of destroyed enemy equipment is emerging, showing that the AFU suffered heavy losses while attempting to withdraw from the region.🎬👆Fighting continues in the Kuriklovka area. More evidence is surfacing from the liberated territories, documenting atrocities committed by nationalists against civilians. Battles are also ongoing near Basovka in the Sumy region. 🔹 In #Liman Section, north of #Terny, reports indicate fighting in the area of #Novolyubovka. 🔹 In #Seversk Sector, the enemy reported Russian activity near 'Sakkо and Vanzetti', a section of the front that has not been mentioned in recent reports. 🔹 In #Toretsk, battles with enemy units continue in different parts of the city. The enemy is still deploying groups into the urban area. 🔹 In #Pokrovsk Direction, fighting continues near #Uspenovka, #Udachnoye, #Kotlino, #Peschanoye, and #Shevchenko. Despite the high intensity of combat, the front line remains largely unchanged. 💥 In #Belgorod Region, in the Volokonovsky district, a private residence in the village of #Konovalovo was damaged by a drone attack. In the hamlet of #Gayevka, a drone strike damaged a piece of specialised machinery. In the Valuysky district, an FPV drone attacked a cargo vehicle in #Kaznacheyevka, while another drone struck a private house. In the village of #Grafovka, Krasnoyaruzhsky district, two drones detonated. In the settlement of #Oktyabrsky, Belgorod district, an FPV drone strike injured two men. Another drone detonated in the settlement of #Dalny, Valuysky district, injuring a woman. In #Shebekino, two FPV drones struck an industrial facility. In the Volokonovsky district, in the village of #Borisovka, a Nazi drone attacked a private residence. 💬Welcome to Military Chat; 🇬🇧Battle Maps 📱 Join GLOBAL DEPTH to boost your TG Feed GLOBAL DEPTH from #HK This channel aims to unite interested individuals from around the world in an attempt to connect the dots. Subscriber participation is always welcome here and in the channel's Chat Group.