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

Пребарај: #techupdate

当前筛选 #techupdate清除筛选
Crypto M - Crypto News

@CryptoM · Post #64676 · 09.04.2026 г., 13:44

🚀 Etherscan Enhances Contract Page with New Features Etherscan has announced a revamp of its contract page, introducing an IDE-style code browser. According to Foresight News, the update includes features such as file tree navigation, multi-file tabs, contract outline jumping, and cross-file keyword search. The redesign also improves the interaction interface for reading and writing contract pages, aiming to enhance the user experience in reading and operating smart contracts. Users can now switch to full-screen mode and open matching contract codes directly in Blockscan and Ethereum Remix for editing. #Etherscan#SmartContracts#Blockchain#Ethereum#CodeBrowser#DeveloperTools#Crypto#IDE#BlockchainDevelopment#TechUpdate#ETH

Crypto M - Crypto News

@CryptoM · Post #65162 · 11.04.2026 г., 14:05

🚀 Hermes Agent Integrates Native Support for Personal WeChat Use Hermes Agent now offers native support for personal WeChat accounts, allowing users to connect easily via QR code for use in private and group chats. According to Foresight News, the adapter utilizes Tencent's official iLink Bot API, enabling comprehensive coverage of images, videos, files, and voice messages, ensuring convenient long-polling direct connections without the need for a public IP. Users can experience this by running 'hermes update'. The adapter employs Tencent's official iLink Bot API rather than reverse engineering protocols or unofficial clients. For users concerned about account bans, it is recommended to test using secondary accounts. #HermesAgent#WeChat#Tencent#iLinkBotAPI#QRcode#GroupChats#PrivateChats#LongPolling#UserExperience#TechUpdate