TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #183 · 23 ное.

Python + bash Если вам часто требуется запускать shell команды из Python-кода, какой способ вы используете? Самый низкоуровневый это функция os.system(), либо os.popen(). Рекомендованный способ это subprocess.call(). Но это всё еще достаточно неудобно. Советую обратить своё внимание на очень крутую библиотеку sh. Что она умеет? 🔸 удобный синтаксис вызова команд как функций # os import os os.system("tar cvf demo.tar ~/") # subprocess import subprocess subprocess.call(['tar', 'cvf', 'demo.tar', '~/']) # sh import sh sh.tar('cvf', 'demo.tar', "~/") 🔸 простое создание функции-алиаса для длинной команды fn = sh.lsof.bake('-i', '-P', '-n') output = sh.grep(fn(), 'LISTEN') в этом примере также задействован пайпинг 🔸 удобный вызов команд от sudo with sh.contrib.sudo: print(ls("/root")) Такой запрос спросит пароль. Чтобы это работало нужно соответствующим способом настроить юзера. А вот вариант с вводом пароля через код. password = "secret" sudo = sh.sudo.bake("-S", _in=password+"\n") print(sudo.ls("/root")) Это не все фишки. Больше интересных примеров смотрите в документации. Специально для Windows💀 юзеров #libs#linux

Hashtags

Резултати

Пронајдени 1,453 слични објави

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

Linuxgram 🐧

@linuxgram · Post #18624 · 30.04.2026 г., 08:59

📰 Rocket League adds Easy Anti-Cheat with Steam Deck / Linux still supported Psyonix have updated Rocket League to add in Epic's Easy Anti-Cheat, but thankfully they've enabled support for Linux / Steam Deck with SteamOS.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/04/rocket-league-adds-easy-anti-cheat-with-steam-deck-linux-still-supported/ #linux#steam

Hashtags

Linuxgram 🐧

@linuxgram · Post #18583 · 27.04.2026 г., 10:26

📰 In the beginning was the Bork: 'Heart of the Earth' exhibit reveals Raspberry Pi in existential crisis Dynamic Earth's ancient rock holds not primordial crystal, but a tiny Linux box having a bad day Bork!Bork!Bork! From the beginning of time, there has always been Bork. Lurking within the heart of this ancient rock is not a precious crystal or a rare fossil. No, it's a Raspberry Pi desktop and dialog.… 🔗 Source: https://go.theregister.com/feed/www.theregister.com/2026/04/27/the_raspberry_pi_turns_up/ #linux#raspberry

Linuxgram 🐧

@linuxgram · Post #18523 · 22.04.2026 г., 06:18

📰 The People Who Put Emulators on Your Steam Deck Now Want to Sell You a Linux Console The Playnix Console is a €1,179 Linux-powered gaming machine with an RX 9060 XT inside. 🔗 Source: https://feed.itsfoss.com/link/24361/17323368/playnix-linux-console #linux#steam

Hashtags

Linuxgram 🐧

@linuxgram · Post #18495 · 20.04.2026 г., 08:59

📰 Playnix launch their own Steam Machine-like Linux gaming console Can't wait on the Steam Machine from Valve? Don't want to build your own? Perhaps the Playnix might be what you want then.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/04/playnix-launch-their-own-steam-machine-like-linux-gaming-console/ #linux#steam

Hashtags

Linuxgram 🐧

@linuxgram · Post #18401 · 12.04.2026 г., 05:36

📰 Classic Capcom horror games are now playable on Linux's Proton—here's how to try them early It was great to see Dino Crisis finally land on Steam earlier this year. Any effort to preserve the classics, clunky or not, should be applauded, as they show us just how far gaming has come since the early days. However, there was just one problem; while Dino Crisis 1 and 2 were being sold on Steam, they didn't want to play nicely on Linux or the Steam Deck. 🔗 Source: https://www.xda-developers.com/classic-capcom-horror-games-are-now-playable-on-linuxs-protonheres-how-to-try-it-early/ #linux#steam

Hashtags

Linuxgram 🐧

@linuxgram · Post #18287 · 02.04.2026 г., 20:19

📰 Linux Continues to Make History, Hitting 5% Usage on Steam Linux continues its rise on Steam, reaching a record 5% share in Valve’s March 2026 Hardware and Software Survey. 🔗 Source: https://linuxiac.com/linux-make-history-hitting-five-percent-usage-on-steam/ #steam#linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18281 · 02.04.2026 г., 09:50

📰 Steam store home page gets a refresh in Beta, plus another Linux SteamRT3 Beta fix Valve have pushed out an overhauled Steam store home page in the latest Steam Client Beta, along with another needed fix for the Linux SteamRT3 Beta.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/04/steam-store-home-page-gets-a-refresh-in-beta-plus-another-linux-steamrt3-beta-fix/ #steam#linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18259 · 31.03.2026 г., 15:12

📰 Lakehopper looks like a wonderful casual seaplane flight simulator Fancy a new type of simulator? How about flying your own seaplane? Lakehopper has launched into Early Access on Steam with Linux support.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/03/lakehopper-looks-like-a-wonderful-casual-seaplane-flight-simulator/ #steam#linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18203 · 26.03.2026 г., 17:42

📰 RTS game PERIMETER: Legate Edition gets Linux ARM64 binaries and Steam Workshop support PERIMETER: Legate Edition is an enhanced version of the retro 2004 RTS game and the latest update expands it even further with modding and Linux ARM64.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/03/rts-game-perimeter-legate-edition-gets-linux-arm64-binaries-and-steam-workshop-support/ #steam#linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18199 · 26.03.2026 г., 14:42

📰 Raspberry Pi Imager 2.0.7 Released With UI Fixes and Improved Device Support Raspberry Pi Imager 2.0.7 delivers UI fixes, improved device support, better search, and multiple bug fixes across Linux, Windows, and macOS. 🔗 Source: https://linuxiac.com/raspberry-pi-imager-2-0-7-released-with-ui-fixes/ #linux#raspberry

Linuxgram 🐧

@linuxgram · Post #18198 · 26.03.2026 г., 13:07

📰 Chaotic party battler where vacuum cleaners face off - Roombattle is out now Need a new silly party game? Roombattle looks properly hilarious and it recently launched on Steam with full Linux support too.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/03/chaotic-party-battler-where-vacuum-cleaners-face-off-roombattle-is-out-now/ #steam#linux

Hashtags

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

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