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

Резултати

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

Пребарај: #send

当前筛选 #send清除筛选
Libreware

@libreware · Post #1003 · 27.10.2021 г., 01:09

Croc Easily and securely send things from one computer to another Features - allows any two computers to transfer data (using a relay) - provides end-to-end encryption (using PAKE) - enables easy cross-platform transfers (Windows, Linux, Mac, Android) - allows multiple file transfers - local server or port-forwarding not needed - ipv6-first with ipv4 fallback https://github.com/schollz/croc https://f-droid.org/en/packages/com.github.howeyc.crocgui/ 📡@NoGoolag📡@Libreware #croc#transfer#send#share

Libreware

@libreware · Post #1550 · 17.02.2026 г., 04:42

Alt-sendme — send files and folders to anywhere in the world without storing them in the cloud — any size, any format, without accounts and restrictions. A free file transfer tool with open source code, using the capabilities of an advanced peer-to-peer network, allowing you to transfer files directly without storing them on cloud servers. @github #P2P#FileTransfer#share#send#transfer

BotsGram®

@botsgram_cu · Post #3988 · 07.06.2021 г., 16:55

@etlgr_bot Qué puede hacer este bot? Obtén una dirección de correo para cualquier Chat de Telegram (grupo o usuario). Enviar y recibir correos. Idioma: Inglés (visto en @BotsGram_cu) #send, #mail, #email, #address, #welcome

BotsGram®

@botsgram_cu · Post #3379 · 11.01.2021 г., 13:10

@Shekelbot Qué puede hacer este bot? ShekelBot le ayudará a contar su dinero. Úselo, cuando le das dinero a alguien, o comparte compras. Idioma: Inglés (visto en @BotsGram_cu) #money, #track, #send, #receive, #friends, #debt

BotsGram®

@botsgram_cu · Post #3357 · 03.01.2021 г., 16:25

@posttobot Qué puede hacer este bot? Este bot le ayuda a enviar un mensaje a alguien en Telegram Messenger sin usar Telegram a través de este Bot conectado con una aplicación web. Idioma: Inglés, Ruso (visto en @BotsGram_cu) #web, #pc, #remote, #telegram, #message, #text, #send, #post, #bot, #dictionary

BotsGram®

@botsgram_cu · Post #3283 · 13.12.2020 г., 03:10

@DebtsTrackerBot Qué puede hacer este bot? Este bot realiza un seguimiento de sus deudas y envía recordatorios a usted y a los deudores por Telegram y SMS. Idioma: Español, Inglés, Ruso, Italiano (visto en @BotsGram_cu) #friend, #money, #track, #debt, #send, #receive, #issue, #website, #request