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 #18152 · 23.03.2026 г., 13:30

📰 The most underrated Windows feature is the built-in OpenSSH server Windows has spent years trying to catch up with workflows that Linux users have taken for granted. Things like package managers, proper terminals, and scripting have slowly improved, but one feature still flies under the radar more than it should. Modern versions of Windows ship with a built-in OpenSSH server. It’s not something you have to install separately from a random GitHub page. It is part of the operating system itself. Despite that,... 🔗 Source: https://www.xda-developers.com/most-underrated-windows-feature-built-in-openssh-server/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18149 · 23.03.2026 г., 11:00

📰 D7VK version 1.6 gets improved vertex processing and VSync handling D7VK v1.6 is another impressive sounding release for the Direct3D 3, 5, 6 7 to Vulkan translation layer bringing further compatibility improvements for Linux.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/03/d7vk-version-1-6-gets-improved-vertex-processing-and-vsync-handling/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18146 · 22.03.2026 г., 22:36

📰 Bottles 63.0 Introduces Proxy Support and Resolves Installation Issues Bottles 63.0, a Wine prefix manager for running Windows applications on Linux, enhances installation reliability and introduces proxy support. 🔗 Source: https://linuxiac.com/bottles-63-0-introduces-proxy-suppor/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18142 · 22.03.2026 г., 17:03

📰 What Are Btrfs Subvolumes? And Why They’re Better Than Traditional Linux Partitions What are Btrfs subvolumes in Linux? Understand how they work and why they are better than traditional partitions with features like snapshots and flexibility. 🔗 Source: https://feed.itsfoss.com/link/24361/17303513/btrfs-subvolumes #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18140 · 22.03.2026 г., 14:59

📰 mdadm 4.6 Released With Boot Failure Fixes, New Lockless Bitmap The mdadm utility for managing software RAID on Linux systems is out with a new release that adds new features while addressing some recent boot failure issues that were reported... 🔗 Source: https://www.phoronix.com/news/mdadm-4.6 #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18139 · 22.03.2026 г., 14:49

📰 BenQ Display Pilot 2 software now has a Linux version BenQ released a Linux version of its Display Pilot 2 software at the end of 2025, but I only heard about this week when reading about the launch of the company’s latest coding monitor. Priced at $699/£599, the BenQ RD280UG is a 28-inch, 3:2 monitor with ‘nano matte’ panel. It runs a 4K+ (3840×2560) resolution at a 120 Hz refresh rate. Also available are a number of monitor-level features controlled by the official Display Pilot 2 software. 🔗 Source: https://www.omgubuntu.co.uk/2026/03/benq-display-pilot-2-linux #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18128 · 20.03.2026 г., 22:04

📰Wine 11.5 Release Is Big: Syscall User Dispatch Feature Supported On Linux Wine 11.5 is out today as the latest bi-weekly development release for this software to run Windows games and applications on Linux and other platforms. Most exciting with Wine 11.5 is the introduction of the Syscall User Dispatch feature on Linux... 🔗 Source: https://www.phoronix.com/news/Wine-11.5-Released #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18127 · 20.03.2026 г., 20:12

📰Linux users swear by simple tools, and now I finally understand why Back when I was a full-time Windows user, I didn't understand why Linux users relied so much on simple tools. Friends of mine who used Linux would rely on tools that looked like they came from the Windows XP era, and when I asked them why they kept using them, they said it was simple, reliable, and worked. I didn't understand it. I liked my modern-day flashy apps. 🔗 Source: https://www.xda-developers.com/linux-users-swear-by-simple-tools-and-now-i-finally-understand-why/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18124 · 20.03.2026 г., 15:46

📰Dell Upstreams Firmware For The XPS Snapdragon X Elite Laptop When it comes to using Qualcomm Snapdragon X1 Elite laptops on Linux, one of the big challenges have involved the need to extract the necessary firmware from the Windows 11 partition due to most vendors not providing the firmware in an easily redistributable and public form. The one exception has been the Lenovo ThinkPad with X1 Elite having upstream firmware in linux-firmware.git while now the Dell XPS model has joined the party too... 🔗 Source: https://www.phoronix.com/news/Dell-Firmware-XPS-13-9345 #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18114 · 19.03.2026 г., 12:48

📰 OpenGL Lands New Extension To Benefit Wine The OpenGL API is still seeing new extensions introduced in 2026. Merged today to the OpenGL Registry is a new extension intended to help Wine usage for 32-bit Windows games/apps on 64-bit Linux systems... 🔗 Source: https://www.phoronix.com/news/OpenGL-Mesa-Wine-Ext #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18113 · 19.03.2026 г., 12:00

📰 Virtual Swap Space Patches Updated For Improving Linux's Swap Design The fourth iteration of patches implementing Virtual Swap Space for Linux were sent out on Wednesday. This stems from ideas going back years for an abstraction to better separate a swap entry from its physical backing storage... 🔗 Source: https://www.phoronix.com/news/Virtual-Swap-Space-Linux-v4 #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18110 · 19.03.2026 г., 10:01

📰 Linux Distributions Begin Blocking Brazil Access Over New Digital Law Several Linux distributions are restricting access from Brazil due to concerns about a new digital law impacting online software distribution. 🔗 Source: https://linuxiac.com/linux-distributions-begin-blocking-brazil-access-over-new-digital-law/ #linux

Hashtags

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