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
📰 Linux Foundation Launches Open Driver Initiative to Strengthen Hardware Support Across Linux
by George WhittakerThe Linux Foundation has announced a new Open Driver Initiative, a collaborative effort aimed at improving the development, maintenance, and long-term sustainability of open-source hardware drivers across the Linux ecosystem.The initiative reflects growing demand for better hardware compatibility in areas ranging from desktops and gaming systems to cloud infrastructure, automotive platforms, AI hardware, and next-generation...
🔗 Source: https://www.linuxjournal.com/content/linux-foundation-launches-open-driver-initiative-strengthen-hardware-support-across-linux
#linux#opensource
📰 Shotcut 26.4 Video Editor Adds Vulkan GPU to Speech to Text on Linux
Shotcut 26.4 open-source video editor is now available for download with Vulkan GPU support for Speech to Text on Linux, 10-bit VP9 MP4 (E-AC-3) and 10-bit VP9 WebM (Opus) export presets, and more.
🔗 Source: https://9to5linux.com/shotcut-26-4-video-editor-adds-vulkan-gpu-to-speech-to-text-on-linux
#linux#opensource
📰 The ps5-linux project can turn some PlayStation 5 consoles into a Linux gaming machine
The open source ps5-linux project has been released, allowing you to turn a PlayStation 5 into a fully fledged Linux gaming machine.Read the full article on GamingOnLinux.
🔗 Source: https://www.gamingonlinux.com/2026/04/the-ps5-linux-project-can-turn-some-playstation-5-consoles-into-a-linux-gaming-machine/
#linux#opensource
📰 Thunderbird 150 Lands on Linux: Smarter Encryption, Better Tools, and a Polished Experience
by George WhittakerMozilla has officially rolled out Thunderbird 150.0, the latest version of its open-source email client, bringing a mix of security-focused enhancements, usability upgrades, and workflow improvements for Linux and other platforms. Released in April 2026, this update continues Thunderbird’s steady evolution as a powerful desktop email solution.
🔗 Source: https://www.linuxjournal.com/content/thunderbird-150-lands-linux-smarter-encryption-better-tools-and-polished-experience
#linux#opensource
📰Linux GPU tool (LACT) gets a new UI and a NVIDIA Voltage-Frequency Curve Editor
The popular open source app, Linux GPU Configuration And Monitoring Tool (LACT), has a huge new release out now with a brand new UI and major new features.Read the full article on GamingOnLinux.
🔗 Source: https://www.gamingonlinux.com/2026/04/linux-gpu-tool-lact-gets-a-new-ui-and-a-nvidia-voltage-frequency-curve-editor/
#linux#opensource
📰 HDMI FRL Support Achieved With Open-Source Nouveau For NVIDIA GPUs
While the AMDGPU open-source driver has struggled with HDMI 2.1 support due to the HDMI Forum blocking open-source implementations, HDMI Fixed Rate Link (FRL) as a feature of the HDMI 2.1 specification is enjoying success now with the open-source Nouveau graphics driver on Linux for NVIDIA GPUs...
🔗 Source: https://www.phoronix.com/news/HDMI-FRL-On-Nouveau-Linux
#linux#opensource
📰 Linux may get a hall pass from one state age-check bill, but Congress plays hall monitor
Colorado amendments could exempt open source OSes, code repos, and containers The prospect of OS-level age checks applying to open source systems is a serious concern for FOSS advocates. Campaigners appear to have secured proposed exemptions for open source operating systems, code repositories, and containers in one US state, but stricter federal legislation has already been introduced in Congress.…
🔗 Source: https://go.theregister.com/feed/www.theregister.com/2026/04/22/linux_us_state_age_verificaiton_laws/
#linux#opensource
📰 CoolerControl 4.2 adds auto detection of new devices, stress-testing and more
The open-source app for monitoring and controlling supported cooling devices on Linux, CoolerControl, has a big new release out with major new features.Read the full article on GamingOnLinux.
🔗 Source: https://www.gamingonlinux.com/2026/04/coolercontrol-4-2-adds-auto-detection-of-new-devices-stress-testing-and-more/
#linux#opensource
📰 Fake Linux leader using Slack to con devs into giving up their secrets
Google Sites lure leads to bogus root certificate Imagine getting asked to do something by a person in authority. An unknown malware slinger targeting open source software developers via Slack impersonated a real Linux Foundation official and used pages hosted on Google.com to steal developers' credentials and take over their systems.…
🔗 Source: https://go.theregister.com/feed/www.theregister.com/2026/04/13/linux_foundation_social_engineering/
#linux#opensource
📰Mainline video capture and camera support for Rockchip RK3588
After over five years of development and collaboration across the Open Source community, mainline Linux support for Rockchip RK3588's video capture hardware has finally landed.
🔗 Source: https://www.collabora.com/news-and-blog/news-and-events/mainline-video-capture-and-camera-support-for-rockchip-rk3588.html
#linux#opensource
📰 Skyscraper brings Bluesky to the Linux terminal
What’s better than using a social network? Not using one, I suppose. Or using one in the nerdiest way you can. Case in point, Skyscraper. Created by developer Cameron Banga, Skyscraper is an open-source terminal client for Bluesky, written in Rust and available on GitHub. It does the core essentials – timeline browsing, posting, replies, reposts, likes and profile viewing.
🔗 Source: https://www.omgubuntu.co.uk/2026/04/skyscraper-bluesky-terminal-client-linux
#linux#opensource