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

Пребарај: #coalapay

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

@venturevillagewall · Post #4108 · 09.02.2025 г., 19:00

End Chokepoint 2.0 Now! Senator Lummis urges that personal beliefs regarding guns, #Bitcoin, crypto, and religion should not affect banking practices, calling for an end to Chokepoint 2.0. In other news, Coala Pay secures $3.50M in Seed funding led by Castle Island Ventures, alongside participation from Lattice Fund and Factor Capital. Read more here: ICO Analytics #Bitcoin#Crypto#VC#Banking#Funding#Chokepoint2.0 #Politics#SenatorLummis#InternationalAid#CoalaPay#Investing#SeedFunding

Venture Village Wall 🦄

@venturevillagewall · Post #4093 · 07.02.2025 г., 19:00

Utah Legislation on Bitcoin Investment Passes 🚀 The Utah House has passed legislation allowing state investment in Bitcoin, moving it to the Senate for further evaluation. 🔗 Read more about the implications of this bill here. 💸 Stablecoin donation company Coala Pay successfully closed a $3.5 million funding round. 🏦 Fed’s Christopher Waller supports stablecoins as vital for USD's reserve currency status. ✨ SEC is reviewing a Solana-ETF application from Grayscale. 📈 Developers of Berachain have launched their mainnet and conducted an airdrop. 🔒 Japan urges Apple and Google to block five crypto exchanges. #Bitcoin#Stablecoin#CoalaPay#Fed#Stablecoins#SEC#Solana#Grayscale#Berachain#Japan#Crypto#Investment#Legislation#VC#News#USA#Fintech#CryptoExchange#DeFi#Funding#Innovation