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

Резултати

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

Пребарај: #failure

当前筛选 #failure清除筛选
News and Tips

@NewsAndTipsNT · Post #3833 · 18.11.2025 г., 13:19

📰 A sharp and unexpected #failure of the Cloudflare hosting provider affected not only many popular sites and services, but also Fragment, the Tonnel gift marketplace and others. 🌩 Developers are studying this problem. UPD: hosting has been restored.

Hashtags

News and Tips

@NewsAndTipsNT · Post #3619 · 12.09.2025 г., 09:47

#failure📰 Domains t.me, telegram.org,fragment.com and stel.com were not working and were partially down and were restored to service a few minutes ago. VPN did not solve the problem partially either.

Hashtags

Лёгкое небо

@legkoenebo · Post #4397 · 22.12.2025 г., 17:50

⚡️Airbus A320 Уральских Авиалиний, следовавший из Дубая в Екатеринбург, произвел экстренную посадку в Ашхабаде (Туркменистан). ❗️Самолет, после 2-х часов полета перед пересечением границы Ирана с Туркменистаном на высоте 10.000м, подал сигнал бедствия и запросил экстренную посадку в ближайшем аэропорту. 💬 Как сообщают Уральские Авиалинии, у двигателей была разница в показаниях топлива. В связи с этим командир принял решение выключить 1 двигатель. Лёгкое небо #emergency#uralairlines#failure#engine#landing

Venture Village Wall 🦄

@venturevillagewall · Post #3444 · 19.12.2024 г., 11:44

Avoid Copycat Mistakes Copying strategies without understanding their context can harm startups. From the experience of a former CTO, mindless imitation of established B2B products leads to failure. Large companies aim to protect their gains, while startups focus on growth. Analyze original strategies instead of copying them blindly. Discover more about proper implementation in the provided link. #Startup#B2B#SaaS#Strategy#Growth#Analysis#Innovation#Business#Entrepreneurship#CTO#Imitation#Failure#Success#Marketing#Learning#Education#BusinessStrategy

Venture Village Wall 🦄

@venturevillagewall · Post #4181 · 18.02.2025 г., 13:00

Crypto Scandal: LIBRA's Dramatic Fall Dave Portnoy attempts to buy tokens after repurposing LIBRA, mistakenly investing $200K in a fraudulent version, which plummeted 93%. Meanwhile, President Javier Milei faces allegations of fraud linked to the LIBRA token. A lawsuit by Argentine lawyers cites the former Central Bank head. CEO Hayden Davis of Kelsier Ventures blames insider selling for the crash. Investigations are ongoing amidst claims of insider knowledge in the token launch. For more insights, check the full news: Forklog News. #Crypto#Argentina#Libra#Miley#Scandal#Failure#InsiderTrading#Lawsuit#Kelsier#Token#Blockchain#Finance#Investigation#HaydenDavis#Fraud#News#Market#Trends#Regulations#DeFi