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

Глобално пребарување

Linuxgram 🐧

@linuxgram · Post #18196 · 26.03.2026 г., 12:33

📰 Steam Client Beta bring fixes for the new Linux SteamRT3 Beta Valve released a fresh update to the Steam Client Beta, bringing a few useful bug fixes and more work on the new Linux SteamRT3 Beta.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/03/steam-client-beta-bring-fixes-for-the-new-linux-steamrt3-beta/ #steam#linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18187 · 25.03.2026 г., 21:08

📰 Proton Experimental brings fixes for Crimson Desert, Steam Overlay with EA games, Death Stranding 2 Valve just pushed out another excellent update for Proton Experimental - further improving Windows games running on Linux / SteamOS.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/03/proton-experimental-brings-fixes-for-crimson-desert-steam-overlay-with-ea-games-death-stranding-2/ #steam#linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18121 · 20.03.2026 г., 11:12

📰Steam Linux Beta Prepares For 64-bit, Can Be Run Inside Steam Runtime Container An interesting new Steam client beta dropped overnight from Valve with some exciting low-level enhancements... 🔗 Source: https://www.phoronix.com/news/Steam-Linux-Beta-In-Container #linux#steam

Hashtags

Linuxgram 🐧

@linuxgram · Post #18041 · 12.03.2026 г., 10:05

📰 Unity announce expanded supported for Steam, Native Linux, Steam Deck and Steam Machine For GDC 2026, Unity revealed expanded official support is coming for Steam. This includes Native Linux, Steam Deck, Steam Machine and more.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/03/unity-announce-expanded-supported-for-steam-linux-steam-deck-and-steam-machine/ #steam#linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #17932 · 28.02.2026 г., 21:01

📰 I'm Low-key Hyped for This Data Center Sim (Though It Has No Official Linux Support) There's a free demo up on Steam right now, and I took it for a spin. 🔗 Source: https://itsfoss.com/data-center-game/ #steam#linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #17890 · 24.02.2026 г., 23:39

📰 Lutris 0.5.21 Adds Steam Sniper Runtime and New Console Emulators Lutris 0.5.21 introduces support for Valve’s Sniper runtime, adds ShadPS4 and Xenia runners, and improves GPU detection on Linux systems. 🔗 Source: https://linuxiac.com/lutris-0-5-21-adds-steam-sniper-runtime-and-new-console-emulators/ #linux#steam

Hashtags

严选君综合福利社

@YXZBP · Post #9355 · 06.04.2026 г., 05:34

🚀Termux ━━━━━━━━━━━━━━━━━ 💡亮点:把安卓手机变成随身携带的Linux终端 📖简介: Termux是一个强大的Android终端模拟器和Linux环境应用,无需root权限就能在手机上运行完整的Linux命令行工具。你可以用它写代码、搭建服务器、运行Python脚本、管理文件系统,甚至安装SSH服务远程控制其他设备。界面简洁,支持插件扩展,是技术爱好者的移动开发神器。 🏷️标签:#开发工具#命令行#Linux#开源 🔗👉 点击直达 ━━━━━━━━━━━━━━━━━ @yxzbp#Tool

Linuxgram 🐧

@linuxgram · Post #18232 · 29.03.2026 г., 12:38

📰 After 6 Years, One of Wayland’s Most Annoying Problems is Finally Getting Fixed The new xdg-session-management protocol finally brings session saving and restoration to Wayland, eliminating a long-standing annoyance for Linux users and paving the way for a smoother desktop experience. 🔗 Source: https://feed.itsfoss.com/link/24361/17308544/wayland-session-management #wayland#linux

Linuxgram 🐧

@linuxgram · Post #18055 · 13.03.2026 г., 21:04

📰Foot: The Wayland Terminal Most Linux Users Don’t Know About Foot is a minimal Wayland-native terminal emulator for Linux that focuses on speed and simplicity. A hidden gem worth exploring. 🔗 Source: https://feed.itsfoss.com/link/24361/17298790/foot-terminal #linux#wayland

Linuxgram 🐧

@linuxgram · Post #17985 · 05.03.2026 г., 20:13

📰 NVIDIA 595.45 Beta Linux Driver Released With Vulkan Updates and Wayland Changes NVIDIA has released the 595.45 beta Linux driver, featuring new Vulkan extensions, Wayland updates, DRI3 1.2 support, and several stability improvements. 🔗 Source: https://linuxiac.com/nvidia-595-45-04-beta-linux-driver-released/ #wayland#linux

Linuxgram 🐧

@linuxgram · Post #17983 · 05.03.2026 г., 18:07

📰 NVIDIA 595.45 Beta Linux Driver Released With Vulkan Updates and Wayland Changes NVIDIA has released the 595.45 beta Linux driver, featuring new Vulkan extensions, Wayland updates, DRI3 1.2 support, and several stability improvements. 🔗 Source: https://linuxiac.com/nvidia-595-45-04-beta-linux-driver-released/ #wayland#linux

Linuxgram 🐧

@linuxgram · Post #17967 · 04.03.2026 г., 18:00

📰 Linux Mint Previews Native Cinnamon Screensaver With Wayland Support Linux Mint introduces a native Cinnamon screensaver with Wayland support and adds a sensors page to System Reports. 🔗 Source: https://linuxiac.com/linux-mint-previews-native-cinnamon-screensaver-with-wayland-support/ #linux#wayland

12•••8283848586•••100•••121122
ПретходнаСтраница 84 од 122Следна