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

Резултати

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

Пребарај: #policychange

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

@CryptoM · Post #65285 · 12.04.2026 г., 14:43

🚀 Russia Implements Full Ban on Crypto-to-Cash Exchanges Russia has enacted a comprehensive ban on crypto-to-cash exchanges, marking a significant policy development in the region. According to NS3.AI, this move is part of a broader trend of regulatory changes across Asia, as countries continue to refine their approaches to cryptocurrency regulation. The ban is expected to impact the way digital currencies are traded and used within Russia, potentially influencing other nations in the region to adopt similar measures. This development is one of several key policy shifts observed in Asia this week, highlighting the evolving landscape of cryptocurrency regulation. #Russia#Cryptocurrency#CryptoRegulation#CryptoBan#DigitalCurrency#Asia#PolicyChange

Venture Village Wall 🦄

@venturevillagewall · Post #3841 · 10.01.2025 г., 19:00

Usual Protocol Announces Key Adjustments Usual Protocol responds to user feedback with two significant changes: 1. Activation of a 1:1 early redemption feature starting next week. 2. Weekly revenue distributions to USUALx holders, with an estimated total of $5 million per month. Details can be found here. Additionally, Kenya prepares to legalize cryptocurrencies, marking a policy shift towards embracing digital assets Read more. #UsualProtocol#Cryptocurrency#Kenya#Crypto#Bitcoin#Blockchain#Finance#DeFi#Investment#Regulation#PolicyChange#Rewards#Earnings#DigitalAssets#Web3#Decentralization#Funding#Innovation#FinanceNews#VC