TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #411 · 9 фев.

reload_flag="" if [[ -n "${DEBUG}" ]]; then reload_flag="--reload" fi if [[ -n "${WORKER_COUNT}" ]]; then workers=${WORKER_COUNT} else workers=2 fi gunicorn --workers ${workers} \ --bind 0.0.0.0:8000 \ ${reload_flag} main.wsgi Писали такие конструкции чтобы проверить наличие флага и сформировать команду правильно? На самом деле можно сделать тоже самое проще. Для этого используются операторы условной подстановки, доступные в оболочках семейства POSIX. :- для установки значений по умолчанию ${WORKER_COUNT:-2} Если переменная не объявлена, то будет дефолтное значение 2. :+ подставляет указанный текст, если переменная не пуста ${DEBUG:+--reload} Если что-то есть в переменной то распечатается текст после символа +, в противном случае - ничего. Удобно для опциональных флагов, как в нашем примере. Итого наш скрипт может выглядеть так: gunicorn --workers ${WORKER_COUNT:-2} \ --bind 0.0.0.0:8000 \ ${DEBUG:+--reload} main.wsgi Есть еще два оператора. := не только подставить дефолтное значение, но и присвоить его переменной, если она пуста # никаких переменных еще нет VAL1=${VAL2:=hello} # теперь доступны обе echo $VAL1 $VAL2 # hello hello :? остановить выполнение с ошибкой, если переменной нет. echo ${MISS:?is required} bash: MISS: is required Код выхода будет 1. #tricks#linux

Резултати

Пронајдени 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