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

Пребарај: #holdings

当前筛选 #holdings清除筛选
Car News

@car_news · Post #999 · 13.02.2025 г., 12:31

📰Nissan, Honda and Mitsubishi refused to collaborate into a single holding company ❌ The companies officially canceled the memorandum of merger signed in December 2024. Negotiations lasted several months, but the parties were unable to reach an agreement. ℹ️ Honda had proposed creating a single holding company in which it would gain management control and appoint a CEO. Another option was to turn Nissan into its subsidiary. Both options Nissan found unacceptable. The companies will now continue to cooperate, but only in software and electric cars. 💰 The collaboration was supposed to help compete with Tesla and BYD. The potential holding company was valued at $50 billion. @CarsNews #holdings#Nissan#Honda#Mitsubishi

Car News

@car_news · Post #950 · 28.01.2025 г., 09:18

🚘Mitsubishi Motors to opt out of Honda-Nissan holding company 📰Mitsubishi Motors has finalized its decision not to participate in the management integration plan proposed by Honda and Nissan, citing fears of being marginalized, sources revealed on January 24. 🚘 Instead, Mitsubishi plans to remain under Nissan, its largest shareholder, while seeking ways to collaborate with both automakers. ℹ️ Honda and Nissan are considering establishing a holding company in August 2026, with plans to delist and operate under a single umbrella. However, Mitsubishi intends to stay outside the holding company framework and maintain its position as a Nissan subsidiary, with Nissan holding just under 30% of Mitsubishi’s shares. @CarsNews #Mitsubishi#Nissan#Honda#holdings

科技&趣闻&杂记

@kejiqu · Post #3920 · 02.12.2025 г., 09:50

OpenAI 又达成了一笔循环交易 OpenAI 宣布获得私募股权投资公司 Thrive Holdings 的所有权,而Thrive Capital是 OpenAI 的主要投资者。OpenAI 将向 Thrive Holdings 的公司提供员工、模型、产品和服务。OpenAI 可能从 Thrive Holdings 的未来回报中获得收益。此次合作将侧重于 IT 服务和会计,目标是利用人工智能提高速度、准确性和成本效率。作为交易的一部分,OpenAI 将获得 Thrive Holdings 公司的数据,用于人工智能模型训练。OpenAI 首席运营官表示,Thrive 交易可能是类似协议新浪潮的第一个案例。The Verge 🏷#OpenAI#Thrive#Holdings#循环交易#投资 📢频道👥群组📝投稿