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

Пребарај: #environmentalengineering

当前筛选 #environmentalengineering清除筛选
Green University CA | Official

@centralasian_greenuniversity · Post #212 · 15.10.2025 г., 12:53

🇪🇺Green University Hosts the 3rd GREENDT Project Meeting! 🗣From October 14 to 17, 2025, Green University hosts the third project meeting and training seminar within the framework of the Erasmus+ GREENDT project — “Implementing Environmental Engineering Master Degrees through Sustainable Transition and Societal Change.” The GREENDT project, funded by the European Union, aims to develop and implement an innovative Master’s program in Environmental Engineering — empowering universities to train future experts who will lead sustainable transformation and support climate action. 💬The event brought together participants from European and Uzbek universities and research institutions. During the sessions, partners discussed project achievements, future plans, and took part in training activities designed to strengthen teaching and institutional capacities in the field of environmental education. #GreenUniversity#GREENDT#ErasmusPlus#Sustainability#EnvironmentalEngineering#HigherEducation#ClimateAction ✉️[email protected] ☎️ +998 55 512 00 77 📍Location 🌐Website | 📱Telegram | 📱Instagram | 📱LinkedIn | 🟥YouTube

Green University CA | Official

@centralasian_greenuniversity · Post #275 · 30.10.2025 г., 11:38

🇮🇹Italy Delegation Visits Green University 📌On October 28, 2025, Green University welcomed a high-level Italian delegation led by H.E. Federico Failla, Ambassador Extraordinary and Plenipotentiary of Italy to Uzbekistan. ✔️During the visit, Acting Rector Sh. Nurulloyev presented the university’s educational, research, and international initiatives and guided the guests through Green University’s campus, research institutes, and climate residence. The Italian side proposed several key initiatives, including: 🟡Joint master’s programs in ecology and environmental engineering; 🟡Student and faculty exchange programs; 🟡Regional events on water management; 🟡Joint research projects on environmental protection and waste recycling; 🟡Establishment of the Italy–Central Asia Environmental Cooperation Center at Green University; 🟡Support for innovative green economy startups. #GreenUniversity#Italy#Cooperation#Sustainability#GreenFuture#EnvironmentalEngineering#Education#ClimateAction ✉️[email protected] ☎️ +998 55 512 00 77 📍Location 🌐Website | 📱Telegram | 📱Instagram | 📱LinkedIn | 🟥YouTube