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

Пребарај: #buidler

当前筛选 #buidler清除筛选
Arweave Announcements

@arweaveannouncements · Post #124 · 26.09.2019 г., 14:55

Our latest community spotlight is here! 🛠️🚀 This week we meet Almaz: Chemical engineering student, all-round creative thinker, and #buidler of WeaveWatcher and Arweave.Design 📢😎http://bit.ly/MeetAlmaz

Hashtags

Buidlpad

@native_fi · Post #136 · 16.12.2025 г., 06:29

Introducing the Buidl Contributor role 🤍 This role is for community members who actively help Buidlpad grow through community participation, support, boosts and engagement. Contribute consistently to unlock future role-based rewards! Join the Buidlpad Discord Community → http://discord.gg/buidlpad ▫️What is the Buidl Contributor Role? Buidl Contributor is the next role in our series of Community Role Launches This role recognizes users who actively support the Buidlpad community by contributing time, effort & presence. It focuses on community participation & engagement, not capital. ▫️How to Get the Buidl Contributor Role? 🔹 Join the Buidlpad Discord: http://discord.gg/buidlpad 🔹 Verify yourself in #buidler-role (skip if you've already done this) 🔹 Choose the contributor role in #role-verify 🔹 Engage the Server Booster Role by Boosting the Server 🔹 Start contributing! The alpha is to stay active in community channels and participate consistently in community activities Roles are reviewed and rewards are calculated on consistent contributions.

Buidlpad

@native_fi · Post #135 · 12.12.2025 г., 11:34

How to verify and receive your roles 🔹 Log in at http://buidlpad.com 🔹 Link your Discord under your Profile 🔹 Join the Buidlpad Discord: http://discord.gg/buidlpad 🔹 Verify yourself in #buidler-verify 🔹 Select your region in #select-region That’s it. Your verification is complete 💙 Or follow this tutorial ⬇️ Or DM : @gBuidl