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

Резултати

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

Пребарај: #kdf

当前筛选 #kdf清除筛选
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

跑跑資訊站 KartInfo

@KartInfoTW · Post #504 · 14.05.2023 г., 08:45

今天 KDL 緊接著登場的是團體賽決賽的對決,由 KDF 對上 LSB,兩隊可以說是世仇了,在飄移季前賽決賽再度交手! 🏁 中韓文轉播/聯賽資訊:https://kinf.cc/TR5U4 ▶️ 追蹤 Google 新聞:https://kinf.cc/gn ▶️ 立即加入 Discord:https://kinf.cc/dc #跑跑卡丁車#KartRider#跑跑飄移#KartDrift#韓服#職業#聯賽#跑跑聯賽#카트리그#KDL#Preseason#團體賽#決賽#KDF#LSB

跑跑資訊站 KartInfo

@KartInfoTW · Post #514 · 22.07.2023 г., 04:01

🔔 KDL PS2 個人賽和團體賽決賽將分別在今明兩天開打,個人賽出賽的選手有 KDF 隊員 + 其他四名選手、團體賽則是老宿主 LSB 將對上 KDF,本季同樣也有韓/英/中三語轉播,更多轉播資訊立即觀看 👇 🏁 完整聯賽資訊:https://kinf.cc/zyi0c ▶️ 追蹤 Google 新聞:https://kinf.cc/gn ▶️ 立即加入 Discord:https://kinf.cc/dc #跑跑卡丁車#KartRider#跑跑飄移#KartDrift#KDL#韓服#聯賽#跑跑聯賽#카트리그#Preseason#DDING#SPEAR#World#JiMin#SUNGBIN#Cool#NEAL#Luning#LSB#KDF#個人賽#團體賽#決賽#finals