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 #18434 · 14.04.2026 г., 16:46

📰 Opera GX for Linux arrives on Flathub & Snap store Installing Opera GX on Linux is now easier, with official packages available on the Canonical Snap Store and Flathub. Opera GX made its debut Linux release in March 2026, with the gaming-centric web browser porting over many of the novel features that have helped to make it a modest hit on Windows and macOS. That includes CPU, RAM and network controls provided, background sounds, themes and eye-candy like web shaders. 🔗 Source: https://www.omgubuntu.co.uk/2026/04/opera-gx-linux-snap-flathub #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18431 · 14.04.2026 г., 15:07

📰Tributary is a GTK4 reimagining of Rhythmbox music player Ever wondered what a GTK4/libadwaita version of Linux music player Rhythmbox might look like? A new app in development imagines just that. Tributary is billed a “high-performance, Rhythmbox-style media manager written in pure Rust with GTK4 and libadwaita”. It’s more than a way to play local audio files, too. Tributary can access and stream music from Jellyfin, Plex, DAAP/iTunes shares, internet radio stations and Subsonic/Navidrome setups as... 🔗 Source: https://www.omgubuntu.co.uk/2026/04/tributary-music-player-gtk4 #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18425 · 14.04.2026 г., 08:51

📰 SteamVR Beta 2.16.3 brings Linux fixes for VRLink Seems SteamVR for Linux really is getting some more attention recently, after a number of fixes in the previous Beta we have a few more here.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/04/steamvr-beta-2-16-3-brings-linux-fixes-for-vrlink/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18415 · 13.04.2026 г., 14:13

📰 FTRFS: New Fault-Tolerant File-System Proposed For Linux Sent out today was an initial patch series for comment on introducing the FTRFS file-system. The FTRFS proposal is more interesting than last week's VMUFAT file-system proposal... 🔗 Source: https://www.phoronix.com/news/FTRFS-Linux-File-System #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18414 · 13.04.2026 г., 13:33

📰 DavMail 6.6 Exchange Gateway Released with Office 365 Fixes DavMail 6.6 improves Exchange and Office 365 access on Linux with authentication fixes, XDG config support, and packaging updates. 🔗 Source: https://linuxiac.com/davmail-6-6-exchange-gateway-released-with-office-365-fixes/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18409 · 13.04.2026 г., 10:45

📰Digital sovereignty isn't just a buzzword – it's the future Linux Foundation Europe boss predicts EU will run as fast as it can from US tech companies Opinion You want to know who's even sicker of President Donald Trump than American liberals? European governments and companies who are realizing that putting all their eggs in one US basket was a stupid move.… 🔗 Source: https://go.theregister.com/feed/www.theregister.com/2026/04/13/digital_sovereignty/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18397 · 11.04.2026 г., 19:17

📰 I stopped organizing my NAS like a PC, and everything got easier to back up and maintain A network-attached storage (NAS) device isn't just another computer on the network. On your PC, you'll have a folder structure with one dedicated to documents, downloads, desktop, and pictures. That's usually how many Linux distros, macOS, and Windows handle things. It works fine for storing files locally, but things can quickly spiral out of control when you've added a few files to the system. 🔗 Source: https://www.xda-developers.com/stopped-organizing-my-nas-like-a-pc/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18395 · 11.04.2026 г., 15:03

📰 SteamOS 3.9 is the closest thing to a perfect desktop Linux I've ever used SteamOS 3.9 fixed the Linux frustrations I’m tired of and came closer to a perfect desktop than I've ever seen. 🔗 Source: https://www.xda-developers.com/steamos-39-closest-thing-perfect-desktop-linux-used/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18393 · 11.04.2026 г., 14:33

📰 FSMOUNT_NAMESPACE Feature Coming For Linux 7.1 Among the new VFS features expected to land for the upcoming Linux 7.1 merge window is FSMOUNT_NAMESPACE... 🔗 Source: https://www.phoronix.com/news/Linux-7.1-FSMOUNT-NAMESPACE #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18392 · 11.04.2026 г., 14:31

📰 Popular macOS Network Monitor Little Snitch Arrives on Linux Little Snitch, long known on macOS, is now available on Linux with app-level network monitoring built around eBPF and a web-based UI. 🔗 Source: https://linuxiac.com/popular-macos-network-monitor-little-snitch-arrives-on-linux/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18385 · 10.04.2026 г., 18:39

📰 Good News! France Starts Plan to Replace Windows With Linux on Government Desktops DINUM is ditching Windows for Linux as France pushes every ministry to draft a migration plan away from non-European software. 🔗 Source: https://feed.itsfoss.com/link/24361/17317062/france-government-linux-switch #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18383 · 10.04.2026 г., 18:38

📰 Proton Experimental brings fixes for classic Resident Evil 1 & 2, Dino Crisis 1 & 2 and more Valve launched the latest upgrade to Proton Experimental, their staging ground for all the latest fixes for Windows games on Linux / SteamOS.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/04/proton-experimental-brings-fixes-for-classic-resident-evil-1-2-dino-crisis-1-2-and-more/ #linux

Hashtags

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