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

Резултати

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

Пребарај: #linuxbased

当前筛选 #linuxbased清除筛选
Linuxgram 🐧

@linuxgram · Post #18775 · 13.05.2026 г., 15:40

📰 The best cheap Linux-based desktop you can buy was never designed to run Linux The M1 Mac mini wasn’t designed to be a Linux desktop, but Asahi Linux has turned it into one of the best cheap machines around. 🔗 Source: https://www.xda-developers.com/best-cheap-linux-based-desktop-never-designed-run/ #linux#linuxbased

Linuxgram 🐧

@linuxgram · Post #18404 · 12.04.2026 г., 17:42

📰I turned my dusty Chromecast into a $250 smart home hub replacement If you've upgraded to a 4K Google TV, an Apple TV, or any other streaming device, you might find that your old 1080p Chromecast dongle is just gathering dust. However, it's got immense potential that you're wasting. It's a Linux-based computer that fits in your palm, draws less than 2W of power, and is designed to stay on 24/7. 🔗 Source: https://www.xda-developers.com/old-chromecast-isnt-trash-one-app-turns-into-dashboard-for-smart-home/ #linux#linuxbased

Linuxgram 🐧

@linuxgram · Post #18359 · 09.04.2026 г., 06:46

📰 TrueNAS 26 Beta Brings Linux 6.18 LTS + OpenZFS 2.4 Combination For NAS Devices TrueNAS 26 Beta released today as the initial test release for this next version of this Linux-based operating system for network attached storage (NAS) devices and more... 🔗 Source: https://www.phoronix.com/news/TrueNAS-26-Beta #linuxbased#linux

Linuxgram 🐧

@linuxgram · Post #18263 · 31.03.2026 г., 18:37

📰 You don't need to wait for SteamOS to have a great couch PC - here's what to use instead SteamOS has become one of the most interesting gaming operating systems in years, mostly because it proves a Linux-based platform can feel polished, console-like, and genuinely easy to game on. On handhelds, Valve has already shown that formula works. The bigger question is whether that same experience can translate cleanly to a home theater PC sitting under a TV. SteamOS points in the right direction, but if you want a couch-friendly gaming PC... 🔗 Source: https://www.xda-developers.com/you-dont-need-steamos-to-have-a-great-couch-pc-heres-what-to-do-instead/ #linux#linuxbased

Linuxgram 🐧

@linuxgram · Post #18141 · 22.03.2026 г., 15:19

📰 Turris Omnia NG Wired Launches as a Linux-Powered 10Gb Router Turris Omnia NG Wired arrives as a Linux-based 10Gb router built for homelabs with fast networking, modular hardware, and long-term support. 🔗 Source: https://linuxiac.com/turris-omnia-ng-wired-launches-as-a-linux-powered-10gb-router/ #linux#linuxbased

Linuxgram 🐧

@linuxgram · Post #17820 · 18.02.2026 г., 07:16

📰 8 Years Later, Linux-based AsteroidOS 2.0 is Here to Add New Life to Your Old Smartwatch The AsteroidOS 2.0 release aims to provide a stable, beautiful base for people who want an open smartwatch today, and an interesting project for developers who want to experiment, learn and contribute. 🔗 Source: https://itsfoss.com/news/asteroidos-2-release/ #linux#linuxbased

Linuxgram 🐧

@linuxgram · Post #17997 · 06.03.2026 г., 17:12

📰ZimaBoard 2: An Interesting Intel-Powered Linux Home Mini Server For those looking for a low-power, well-built small office / home office Linux server with interesting connectivity options, the ZimaBoard 2 is an interesting option that has been available for some months now and powered by the Intel N150 processor. Besides the interesting single board hardware and well built aluminum chassis, the offering is rounded out by being preloaded with ZimaOS as a Linux-based "personal cloud OS" to easily get hosting... 🔗 Source: https://www.phoronix.com/review/zimaboard2 #intel#linux#linuxbased

Linuxgram 🐧

@linuxgram · Post #17941 · 02.03.2026 г., 09:01

📰Orange Pi Neo Linux-powered handheld gaming PC delayed indefinitely due to RAM & SSD increases It’s been nearly two years since Manjaro Linux developed revealed they were working with single board PC maker Orange Pi to launch a handheld gaming PC called the Orange Pi Neo, which was set to feature an AMD Ryzen processor and Linux-based software. But it looks we’ll have to wait at least a little longer for . 🔗 Source: https://liliputing.com/orange-pi-neo-linux-powered-handheld-gaming-pc-delayed-indefinitely-due-to-ram-ssd-increases/ #amd#orangepi#linux#linuxbased