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

Пребарај: #azerbaijanstartups

当前筛选 #azerbaijanstartups清除筛选
StartupBase

@startupbaseuz · Post #6336 · 06.11.2025 г., 10:21

🇦🇿 Ozarbayjonda Best Startup Project yarim final bosqichi bo‘lib o‘tdi! “Digital Startup Awards” (DSA) butun mintaqa bo‘ylab eng iqtidorli startap asoschilarini birlashtirishda davom etmoqda. 🌟 Dunyo bo‘ylab kelib tushgan 350 dan ortiq ariza orasidan 20 ta ozarbayjonlik startap o‘z innovatsion g‘oyalarini taqdim etdi. Natijada ikki finalchi — “Starkids” va “Tryverse” — joriy yil dekabr oyida Toshkentda bo‘lib o‘tadigan Grand Final bosqichiga yo‘llanma oldi. 🚀 Jarayon tobora qizg‘in tus olmoqda — yakuniy bosqichga yaqinlashar ekanmiz, yangiliklarni kuzatishda davom eting! 📖To‘liq maqolani o'qing: startupbase.uz — 🇦🇿Azerbaijan Hosts Its Best Startup Project Semifinal! The Digital Startup Awards (DSA) continues to bring together the brightest founders from across the region. 🌟 Out of 350+ applications globally, 20 startups from Azerbaijan took the stage to pitch their innovative ideas — and two finalists, Starkids and Tryverse, have earned their spot in the Grand Final in Tashkent this December. 🚀 The momentum is growing — stay tuned as we move closer to the final showdown! 📖Read the full article here: startupbase.uz #DSA#BestStartupProject#ITParkUzbekistan#AzerbaijanStartups#CentralAsiaStartups

IT Park Ventures

@ITParkVentures · Post #495 · 06.11.2025 г., 11:30

🇦🇿 Ozarbayjonda Best Startup Project yarim final bosqichi bo‘lib o‘tdi! “Digital Startup Awards” (DSA) butun mintaqa bo‘ylab eng iqtidorli startap asoschilarini birlashtirishda davom etmoqda. 🌟 Dunyo bo‘ylab kelib tushgan 350 dan ortiq ariza orasidan 20 ta ozarbayjonlik startap o‘z innovatsion g‘oyalarini taqdim etdi. Natijada ikki finalchi — “Starkids” va “Tryverse” — joriy yil dekabr oyida Toshkentda bo‘lib o‘tadigan Grand Final bosqichiga yo‘llanma oldi. 🚀 Jarayon tobora qizg‘in tus olmoqda — yakuniy bosqichga yaqinlashar ekanmiz, yangiliklarni kuzatishda davom eting! 📖To‘liq maqolani o'qing: startupbase.uz — 🇦🇿Azerbaijan Hosts Its Best Startup Project Semifinal! The Digital Startup Awards (DSA) continues to bring together the brightest founders from across the region. 🌟 Out of 350+ applications globally, 20 startups from Azerbaijan took the stage to pitch their innovative ideas — and two finalists, Starkids and Tryverse, have earned their spot in the Grand Final in Tashkent this December. 🚀 The momentum is growing — stay tuned as we move closer to the final showdown! 📖Read the full article here: startupbase.uz #DSA#BestStartupProject#ITParkUzbekistan#AzerbaijanStartups#CentralAsiaStartups