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

Резултати

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

Пребарај: #send

当前筛选 #send清除筛选
Libreware

@libreware · Post #1003 · 27.10.2021 г., 01:09

Croc Easily and securely send things from one computer to another Features - allows any two computers to transfer data (using a relay) - provides end-to-end encryption (using PAKE) - enables easy cross-platform transfers (Windows, Linux, Mac, Android) - allows multiple file transfers - local server or port-forwarding not needed - ipv6-first with ipv4 fallback https://github.com/schollz/croc https://f-droid.org/en/packages/com.github.howeyc.crocgui/ 📡@NoGoolag📡@Libreware #croc#transfer#send#share

Libreware

@libreware · Post #1550 · 17.02.2026 г., 04:42

Alt-sendme — send files and folders to anywhere in the world without storing them in the cloud — any size, any format, without accounts and restrictions. A free file transfer tool with open source code, using the capabilities of an advanced peer-to-peer network, allowing you to transfer files directly without storing them on cloud servers. @github #P2P#FileTransfer#share#send#transfer

BotsGram®

@botsgram_cu · Post #3988 · 07.06.2021 г., 16:55

@etlgr_bot Qué puede hacer este bot? Obtén una dirección de correo para cualquier Chat de Telegram (grupo o usuario). Enviar y recibir correos. Idioma: Inglés (visto en @BotsGram_cu) #send, #mail, #email, #address, #welcome

BotsGram®

@botsgram_cu · Post #3379 · 11.01.2021 г., 13:10

@Shekelbot Qué puede hacer este bot? ShekelBot le ayudará a contar su dinero. Úselo, cuando le das dinero a alguien, o comparte compras. Idioma: Inglés (visto en @BotsGram_cu) #money, #track, #send, #receive, #friends, #debt

BotsGram®

@botsgram_cu · Post #3357 · 03.01.2021 г., 16:25

@posttobot Qué puede hacer este bot? Este bot le ayuda a enviar un mensaje a alguien en Telegram Messenger sin usar Telegram a través de este Bot conectado con una aplicación web. Idioma: Inglés, Ruso (visto en @BotsGram_cu) #web, #pc, #remote, #telegram, #message, #text, #send, #post, #bot, #dictionary

BotsGram®

@botsgram_cu · Post #3283 · 13.12.2020 г., 03:10

@DebtsTrackerBot Qué puede hacer este bot? Este bot realiza un seguimiento de sus deudas y envía recordatorios a usted y a los deudores por Telegram y SMS. Idioma: Español, Inglés, Ruso, Italiano (visto en @BotsGram_cu) #friend, #money, #track, #debt, #send, #receive, #issue, #website, #request