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

Резултати

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

Пребарај: #responsibility

当前筛选 #responsibility清除筛选
EKOLOG.UZ| ENG

@ekologuzenglish · Post #11063 · 05.01.2026 г., 01:02

🏢 The State Duma warns residents about the risk of rodent infestations 🐀 If there are no cats in the basements, “attacking wildlife” can appear. By sealing vents and boarding up basements, management companies violate government regulations and common sense. Vladimir Burmatov, First Deputy Chairman of the State Duma Committee on Ecology, noted that this does not help residents — on the contrary, it creates a threat. It is important for cats to have a safe place to shelter from the cold and naturally control rodent populations. Protect your homes and the environment! 🐾 #Ecology#AnimalProtection#Responsibility#RodentControl ☘️Read the latest environmental news on the @ekologuz page. Follow us and send your suggestions and wishes via @eklguz_bot Instagram | Facebook | Twitter | Sayt | Youtube.

EKOLOG.UZ| ENG

@ekologuzenglish · Post #11053 · 03.01.2026 г., 08:04

❗️ Attention! Animal Cruelty Alert In Uzbekistan, cases of intentional harassment of birds, including falcons, have been reported on social media by Instagram users under the account @ake.falcon1. These actions occur not in the wild, but in suburban and residential areas where people, children, and domestic animals are present. ✅ Key points: This is not hunting and not a tradition, but deliberate cruelty. Such actions pose a danger to animals and people alike. 📌 Legislation: According to the Law of the Republic of Uzbekistan “On the Protection and Use of the Animal World” (Art. 43) and Cabinet of Ministers’ regulations, as of January 1, 2025, it is prohibited to: Keep any species of falconiform birds (Clause 35) Use them for harassment Publish videos showing acts of violence Violation of these norms constitutes a direct breach of the law. ⚠️ Calls to action: Notify the National Committee for Ecology and Climate Change Engage law enforcement to assess the offenders’ actions Raise public awareness about legal responsibility 🔴 Important: Public cruelty must not go unpunished. Ignoring it today shifts the boundaries of what is acceptable tomorrow. 💡 Respect for animals is a hallmark of a civilized society. Everyone is responsible for preventing violence. #Ecology#AnimalProtection#Responsibility#Uzbekistan#PR#SocialAwareness☘️Read the latest environmental news on the @ekologuz page. Follow us and send your suggestions and wishes via @eklguz_bot Instagram | Facebook | Twitter | Sayt | Youtube.

EKOLOG.UZ| ENG

@ekologuzenglish · Post #11165 · 12.01.2026 г., 08:02

🌱 Falsification in the “Green Space” Project and the Question of Responsibility! In the Yakkabog district of Qashqadaryo region, as part of the “Green Space 2025” project, unsown tree seedlings were entered into the electronic platform as planted, which distorts the official reports. Instead of fairly implementing the wise environmental policy of our respected President, some managers intimidated employees, artificially inflating the numbers: as a result, it appears that 70–80% more trees were added in the green area. According to the whistleblower, the head of the Yakkabog district ecology department handed over the electronic platform key to the municipal improvement employees, which allowed incorrect data about the trees to be entered. The actions of Y. Jumayev should be thoroughly investigated by the Committee on Ecology, and the managers involved in the falsification should be held accountable. 🌿 Protecting nature is the responsibility not only of employees but of society as a whole! #GreenSpace#Ecology#Qashqadaryo#Responsibility#Justice#SaveNature ☘️Read the latest environmental news on the @ekologuz page. Follow us and send your suggestions and wishes via @eklguz_bot Instagram | Facebook | Twitter | Sayt | Youtube