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

Пребарај: #sicw

当前筛选 #sicw清除筛选
Russian Mission to ASEAN

@aseanrussia · Post #718 · 20.10.2023 г., 14:31

Embassy of the Russian Federation in Singapore 🗓 On October 16-19, delegation led by the Special Representative of the President of the Russian Federation for International Cooperation in the Field of Information Security, Director of the Department of International Information Security of the Russian MFA H.E. Mr. Artur Lyukmanov 🇷🇺 took part in the 8th Singapore International Cyber Week (#SICW). 🔹️Russia consistently promotes dialogue and cooperation in the #ICT domain, advocates for unified negotiation track on international information security issues under the UN auspices after 2025. Russia firmly supports the efforts of the OEWG under the able chairmanship of Singapore PR to the UN H.E. Burhan Gafoor 🇸🇬 and Ad-Hoc Committee to elaborate a comprehensive international convention on combating the use of ICTs for criminal purposes. 🔹️ Russia is eager to build up engagement with #ASEAN Member States with a special emphasis on capacity building in combating the use of ICTs for criminal purposes. On the sidelines of the SICW the Russian delegation held bilateral meetings with Laos 🇱🇦, Malaysia 🇲🇾, the Philippines 🇵🇭, Vietnam 🇻🇳, Thailand 🇹🇭, Brunei 🇧🇳 and Singapore 🇸🇬 to discuss issues of common concern.