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
📰openSUSE’s Agama Installer 19 Released with Major Architectural Overhaul
openSUSE's new Agama Linux installer v19 arrives with a redesigned core architecture, new API foundation, improved web UI, and more.
🔗 Source: https://linuxiac.com/opensuses-agama-installer-19-released-with-major-architectural-overhaul/
#opensuse#linux
📰 Libcamera 0.7.1 Released With Improved Software ISP
Libcamera 0.7.1 released on Tuesday as the newest feature release for this open-source library for camera image signal processors (ISPs) that has grown of importance for the likes of Raspberry Pi and Chrome OS and modern desktop Linux distributions with modern laptop hardware like recent Intel Core (Ultra) laptops...
🔗 Source: https://www.phoronix.com/news/libcamera-0.7.1-Released
#intel#linux#opensource#raspberry
📰 Intel's Vulkan Linux Driver Lands New Feature To Boost DX12 Game Performance
Intel's open-source "ANV" Vulkan driver for Linux systems enabled a new feature called BTP+BTI RCC Keying. You may be wondering what it means or stands for, but long story short it helps with the performance of Direct3D 12 (DX12) games running on Linux by way of Valve's Steam Play with Proton + VKD3D-Proton...
🔗 Source: https://www.phoronix.com/news/Intel-ANV-BTP-BTI-RCC-Keying
#steam#opensource#linux#intel
📰 EndeavourOS Titan Neo Is Out with KDE Plasma 6.6.4 and KDE Gear 26.04
EndeavourOS Titan Neo distribution is now available for download with the KDE Plasma 6.6.4 desktop environment, Linux kernel 6.19.12, and other changes. Here’s what’s new!
🔗 Source: https://9to5linux.com/endeavouros-titan-neo-is-out-with-kde-plasma-6-6-4-and-kde-gear-26-04
#kde#kernel#linux#plasma
📰 EndeavourOS Titan Released with Linux Kernel 6.19 and KDE Plasma 6.6
EndeavourOS Titan distribution is now available for download with Linux kernel 6.19, KDE Plasma 6.6, and other changes. Here’s what’s new!
🔗 Source: https://9to5linux.com/endeavouros-titan-released-with-linux-kernel-6-19-and-kde-plasma-6-6
#plasma#kde#kernel#linux
📰 I tried Fedora and learned why it's not the beginner Linux distro everyone assumes it is
Fedora is one of the best Linux distros out there, but if you're a beginner, it's probably not the best place to start.
🔗 Source: https://www.xda-developers.com/tried-fedora-learned-why-not-beginner-distro-everyone-assumes-it-is/
#distro#linux#fedora
📰 Fedora Project Leader Suggests Linux Distros Could Adopt Apple's Age Verification API
He thinks a cross-distro API standard can be a practical solution to tackle age verification.
🔗 Source: https://feed.itsfoss.com/link/24361/17306020/fedora-leader-suggests-age-verification-api
#fedora#linux#distro
📰 Fedora Pocketblue Remix is an atomic Linux distro for mobile devices (phones and tablets)
Fedora Pocketblue Remix is a mobile Linux distribution designed to let you run Fedora on a smartphone or tablet. But unlike most mobile Linux distros, Pocketblue is an atomic distro. In a nutshell, that means it’s an operating system that’s harder to break because of the way updates are installed. Basically, new package updates are .
🔗 Source: https://liliputing.com/fedora-pocketblue-remix-is-an-atomic-linux-distro-for-mobile-devices-phones-and-tablets/
#linux#fedora#distro
📰 Lilbits: Vertical tabs for Chrome, Mac OS 10 for the Nintendo Wii, and a CyberDeck Pi
The CyberDeck Pi is a DIY handheld computer that looks like something designed for a world where smartphones never existed. It’s a chunky device that probably won’t fit in your pocket. But it’s also a full-fledged computer that can run desktop GNU/Linux software thanks to its Raspberry Pi brains. And it’s made using a combination .
🔗 Source: https://liliputing.com/lilbits-vertical-tabs-for-chrome-mac-os-10-for-the-nintendo-wii-and-a-cyberdeck-pi/
#gnu#raspberry#linux
#cmake#audio#ios#linux#macos#plugins#sdk#vst3#win32
VST 3 is an improved version of the VST audio plug-in interface. It offers several benefits, including better performance by only processing audio when needed, dynamic input/output configurations, and precise automation. Users can also enjoy a more organized interface and support for advanced audio features like 3D sound. These improvements make it easier for developers to create plugins and for users to work with them in digital audio workstations (DAWs), enhancing overall audio production efficiency.
https://github.com/steinbergmedia/vst3sdk