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

Пребарај: #superagent

当前筛选 #superagent清除筛选
GitHub Trends

@githubtrending · Post #15523 · 25.02.2026 г., 12:30

#typescript#agent#agentic#agentic_framework#agentic_workflow#ai#ai_agents#bytedance#deep_research#harness#langchain#langgraph#langmanus#llm#multi_agent#nodejs#podcast#python#superagent#typescript DeerFlow 2.0 is an open-source super agent harness that orchestrates multiple sub-agents, memory systems, and sandboxed execution environments to accomplish complex tasks. Built on LangGraph and LangChain, it combines research, coding, and content creation capabilities with extensible skills and tools. The platform features isolated Docker containers for safe execution, long-term memory that learns your preferences, and the ability to spawn sub-agents that work in parallel on different task angles. You benefit from dramatically reduced research and automation time—tasks that typically take hours complete in minutes—while maintaining full transparency and control over agent decisions through human-in-the-loop collaboration. Whether you need deep research reports, data analysis, slide decks, or custom workflows, DeerFlow handles multi-step complexity without requiring extensive coding knowledge. https://github.com/bytedance/deer-flow