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

Резултати

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

Пребарај: #ainft

当前筛选 #ainft清除筛选
HTX Announcements

@htxglobalannouncementchannel · Post #14511 · 12.02.2026 г., 04:52

📘Understanding #Web3 AI with #AINFT From #ChatGPT to #Claude, we break down how top #AI models work — and how AINFT unifies them on one platform.🤖 No hype. Just clarity. 🗓 12 Feb · 8AM (UTC) 📍 Venue: HTX English Telegram Group ✈️Telegram | ✖️X ✅Announcements

Crypto M - Crypto News

@CryptoM · Post #65388 · 13.04.2026 г., 04:14

🚀 AINFT Platform Surpasses 700,000 Users, Advances in Web3 AI The AINFT platform has officially exceeded 700,000 users, according to official data. According to Odaily, the growing user base and the continuous enhancement of AI model capabilities are propelling it to become a leading AI platform in the Web3 sector. AINFT currently offers users AI models ready for production and fully supports the execution of on-chain automated workflows, facilitating a rapid transition from creative ideas to on-chain implementation. Leveraging its expanding community and open technical architecture, AINFT aims to lower the barriers to using Web3 AI, enabling more efficient deployment of innovative applications. #AINFT#700000Users#Web3#AIPlatform#AI#Blockchain#OnChain#AutomatedWorkflows#Web3AI#Innovation#Technology#Community

Crypto M - Crypto News

@CryptoM · Post #64620 · 09.04.2026 г., 11:35

🚀 AINFT Transitions to B.AI Brand Focused on Agent Finance The official Twitter account of AINFT will transition to B.AI starting today. According to ChainCatcher, the B.AI brand aims to advance Agent Finance, which involves AI Agents autonomously managing funds, executing trades, and optimizing returns, thereby granting artificial intelligence true financial autonomy and accelerating the realization of Artificial General Intelligence (AGI). To ensure a smooth transition for the community, the brand will implement phased upgrades to avoid the impact of a one-time switch. During this process, AINFT will continue to operate as a core sub-brand within the B.AI ecosystem. All content, technological iterations, and community activities related to AINFT will be migrated to the new platform @AINFTcom. #B_AI#Agent_Finance#AI_Agents#Artificial_Intelligence#AGI#Technology_Transition#AINFT#Financial_Autonomy#Blockchain#Crypto