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

Пребарај: #hesterpeirce

当前筛选 #hesterpeirce清除筛选
Venture Village Wall 🦄

@venturevillagewall · Post #3944 · 21.01.2025 г., 22:00

Trump Calls for Ross Ulbricht's Release Senator Rand Paul urges President Trump to free Ross Ulbricht, the founder of Silk Road. Meanwhile, Coinbase CEO Brian Armstrong states Trump is excited about a Strategic Bitcoin Reserve, aiming to be the first Bitcoin President. Additionally, Binance's CEO predicts a crypto all-time high in 2025 amid clearer U.S. regulation under Trump. Critical Metals Corp raises $500M for Bitcoin reserve strategy as they accept BTC as treasury asset—first Nasdaq company in critical minerals sector to do so. 🔗 Related articles from Watcher Guru and CoinDesk. #Bitcoin#USDC#Crypto#Trump#Coinbase#Binance#HesterPeirce#SEC#Decentralization#Finance#Investment#CriticalMetals#Aviation#Regulation#Liberty#Decentralized#Blockchain#CryptoNews#VC #Bitcoin#USDC#Crypto#Trump#Coinbase#Binance#HesterPeirce#SEC#Decentralization#Finance#Investment#CriticalMetals#Aviation#Regulation#Liberty#Decentralized#Blockchain#CryptoNews#VC

Venture Village Wall 🦄

@venturevillagewall · Post #4226 · 23.02.2025 г., 22:00

Biden Faces Bitcoin Chaos; SEC Crypto Shift 🚨 The Biden administration and U.S. Marshals Service can't account for billions in Bitcoin, raising concerns of theft. Meanwhile, 29.5M #XRP valued at $75.4M transferred to #Coinbase. 🔍 The SEC is reportedly dismantling its crypto enforcement program, potentially ending the Ripple appeal. Former SEC chief John Reed Stark highlights a shift in the SEC’s regulatory approach, with key figures removed from crypto litigation. Major changes expected, including a rebranding of the crypto unit and possible suspension of crypto enforcement. Expect deeper institutional instability and a new landscape for digital assets. 🔗Details on XRP Transfer | Leviathan News on Bybit Hack #Bitcoin#XRP#Coinbase#SEC#Crypto#Ripple#SOL#Bybit#Blockchain#Enforcement#Regulation#DigitalAssets#SECReform#Compliance#HesterPeirce#Laundering#WhaleAlert#CryptoInvestigation#MarketTrends#USTreasury#VC