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

Резултати

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

Пребарај: #globalcommerce

当前筛选 #globalcommerce清除筛选
Crypto M - Crypto News

@CryptoM · Post #64457 · 09.04.2026 г., 01:01

🚀 CZ's Five-Year Vision: Crypto Becomes Ambient Finance Speaking on The Wolf of All Streets Podcast, Binance co-founder Changpeng Zhao (CZ) said he expects crypto to become invisible infrastructure within five years — used universally without being discussed as a distinct technology, in the same way the internet's underlying protocols are no longer part of everyday conversation. He said AI agents will be substantial users of crypto, and that the growing demand for global commerce applications requiring cross-border payments will further accelerate blockchain adoption. CZ also described his post-Binance identity as that of a mentor and coach to other founders, and said he is "actually quite lucky and quite happy to have been forced to step down," framing the transition as creating space for others to grow. He said he wants to dedicate his energy to helping the next generation of founders. #CZ#Binance#crypto#blockchain#AI#crossborderpayments#globalcommerce#ambientfinance#mentor#founders#leadership#BNB