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

Резултати

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

Пребарај: #spreadsheet

当前筛选 #spreadsheet清除筛选
Чартомойка

@chartomojka · Post #1328 · 14.04.2025 г., 20:27

Google встроил AI прямо в Google Sheets — на уровне формул. Больше не нужно вспоминать, как писать VLOOKUP или придумывать хитрые конструкции для сложных задач. Теперь достаточно написать промпт в =AI() — и модель сама поймёт, что в ячейках, и вернёт нужный результат. Примеры, что можно делать прямо в таблице в комметариях. #google#spreadsheet#ai ————————— Мысли Рвачева —————————

djangoproject

@djangoproject · Post #316 · 28.04.2017 г., 06:09

https://github.com/blissnd/easyxls Convert any #spreadsheet into a Python internal #dict/#array data structure, for easy processing. Can also handle pivot tables. For pivot table usage, header_row_start & header_col_start need to be set equal to the top left corner of the pivot table => header_row_start=8, header_col_start='c' in the included example. Column IDs must always be lowercase chars in quotes, e.g. 'a'.

GitHub Trends

@githubtrending · Post #15244 · 24.10.2025 г., 12:30

#python#airtable#airtable_alternative#airtable_replacement#application_builder#automations#dashboards#database#low_code#no_code#no_code_database#no_code_platform#online_database#postgresql#restful_api#self_hosted#spreadsheet Baserow is a powerful, open-source tool that lets you build databases and applications without coding. It offers full control over your data and environment, allowing self-hosting and customization. Unlike Airtable, Baserow doesn't limit your data storage or API calls, making it ideal for large projects. It combines the ease of a spreadsheet with advanced data management features, including dashboards and automation tools. This gives users complete ownership of their data and avoids vendor lock-in, making it a great choice for businesses needing flexibility and scalability. https://github.com/baserow/baserow