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

Пребарај: #peertopeer

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

@venturevillagewall · Post #3780 · 03.01.2025 г., 10:00

Bitcoin Turns 16: Celebrating Blockchain's Birth 🎉 Bitcoin celebrates its 16th anniversary today, marking the generation of its genesis block on January 3, 2009, by Satoshi Nakamoto. This milestone began a monetary revolution focused on decentralization and sovereignty. 🔗 Read more: Celebrating Bitcoin 🔗 Earlier report: Identity of Satoshi Nakamoto Revealed? ⚖️ On a legal note, Do Kwon faces serious accusations including fraud and money laundering, with a potential prison sentence of 130 years if convicted. His next court hearing is set for January 8. 🔗 More on Kwon: Reuters 🔮 Experts predict significant developments for cryptocurrency and AI integration by 2025, with Bitcoin potentially hitting $500,000. #Bitcoin#SatoshiNakamoto#DoKwon#Terra#Crypto#Blockchain#Fraud#MoneyLaundering#AI#VC#Economy #2025 #Cryptocurrency#Investment#BlockchainTechnology#Legal#Innovation#Milestone#Anniversary#Decentralization#PeerToPeer

Venture Village Wall 🦄

@venturevillagewall · Post #4026 · 30.01.2025 г., 04:00

Bitcoin Tax Fraud Case Sentenced Texas resident Frank Richard Ahlgren III faces two years in prison for tax evasion linked to the sale of $4M in Bitcoin. Ordered to pay $1,095,031 in restitution, this marks the first purely crypto-related tax fraud case in the U.S. Ahlgren concealed transactions using multiple wallets and mixers like CoinJoin and Wasabi Wallet. Details: source #Bitcoin#Crypto#TaxFraud#Blockchain#USA#Court#Restitution#Legal#Finance#Tax#CryptoRegulation#CryptoNews#Ahlgren#PeerToPeer#Wallets#Mixers#CoinJoin#WasabiWallet#Chainalysis#Investigation#Fraud