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 #18234 · 29.03.2026 г., 16:17

📰 Linux Ham Radio KISS Serial Driver Being Modernized In 2026 Here's something that wasn't on my bingo card for this year of the "MKISS" driver for ham radio being modernized in 2026 as opposed to just being dropped. The MKISS code hasn't seen much driver activity since the original Git import of the Linux kernel more than twenty years ago... 🔗 Source: https://www.phoronix.com/news/Linux-Ham-Radio-MKISS-2026 #linux#kernel

Linuxgram 🐧

@linuxgram · Post #18222 · 28.03.2026 г., 14:45

📰 Linux 7.0-rc6 Bringing A Lot Of Audio Quirks / Fixes The Linux 7.0-rc6 kernel due for release tomorrow has a lot of audio fixes/quirks to correct a wide variety of different hardware issues, mostly different problematic laptops for their speakers and/or microphone behavior under Linux... 🔗 Source: https://www.phoronix.com/news/Linux-7.0-rc6-Many-Audio-Fixes #linux#kernel

Linuxgram 🐧

@linuxgram · Post #18218 · 28.03.2026 г., 08:14

📰 DRBD Driver Working To Land ~15 Years Worth Of Changes Into The Linux Kernel Developers behind the Distributed Replicated Block Device "DRBD" for mirroring block devices between multiple host systems are working to resync the upstream Linux kernel DRBD support with the out-of-tree DRBD code they have been maintaining for the past ~15 years out-of-sync. It's a big undertaking but they have begun staging patches for review and testing to get this massive set of changes up to par for mainline... 🔗 Source: https://www.phoronix.com/news/DRBD-15-Years-Code-Changes #linux#kernel

Linuxgram 🐧

@linuxgram · Post #18212 · 27.03.2026 г., 14:05

📰 BPF-Based I/O Scheduler For Linux Demonstrated With sched_ext there is support for BPF-based CPU scheduling policies for the Linux kernel while now a new initiative is working on BPF-based I/O schedulers... 🔗 Source: https://www.phoronix.com/news/BPF-IO-Scheduler-Linux #linux#kernel

Linuxgram 🐧

@linuxgram · Post #18211 · 27.03.2026 г., 11:32

📰 AMDGPU Driver For Linux 7.1 Preps Debug Improvements, New Hardware IP Another round of AMDGPU/AMDKFD kernel driver improvements were sent out this week as feature development for DRM-Next ahead of Linux 7.1 begins to wind down... 🔗 Source: https://www.phoronix.com/news/Linux-7.1-More-AMDGPU #linux#kernel

Linuxgram 🐧

@linuxgram · Post #18210 · 27.03.2026 г., 10:33

📰 Linux Patches Posted To Fix ~2x Performance Drop For CPU Workloads On NVIDIA Vera Rubin An important set of Linux scheduler patches were posted for review on Thursday for improving the SMT-aware asymmetric CPU capacity handling. These patches to improve the Linux kernel scheduler around CPU Simultaneous Multi-Threading (SMT) is needed after NVIDIA engineers discovered up to a ~2x performance drop for CPU-intensive workloads on their upcoming Vera Rubin platform... 🔗 Source: https://www.phoronix.com/news/NVIDIA-Vera-Rubin-SMT-Sched-Fix #linux#kernel

Linuxgram 🐧

@linuxgram · Post #18200 · 26.03.2026 г., 15:21

📰 AI bug reports went from junk to legit overnight, says Linux kernel czar Greg Kroah-Hartman can't explain the inflection point, but it's not slowing down or going away Interview I was at a press luncheon at KubeCon Europe this week when, to my surprise, who should sit down next to me but long-term Linux kernel maintainer Greg Kroah-Hartman. Greg, who lives in the Netherlands these days, was there to briefly comment on AI, Linux, and security. 🔗 Source: https://go.theregister.com/feed/www.theregister.com/2026/03/26/greg_kroahhartman_ai_kernel/ #linux#kernel

Linuxgram 🐧

@linuxgram · Post #18173 · 24.03.2026 г., 22:22

📰 Oracle Releases Unbreakable Enterprise Kernel 8.2 - Still On Linux 6.12 LTS Base Days after Oracle celebrated their RHEL-based Oracle Linux distribution turning 20 years old, today they announced Unbreakable Enterprise Kernel 8.2 "UEK 8.2" as their alternative to the RHEL-clone kernel with Oracle Linux... 🔗 Source: https://www.phoronix.com/news/Unbreakable-Enterprise-UEK-8.2 #linux#kernel

Linuxgram 🐧

@linuxgram · Post #18159 · 23.03.2026 г., 18:47

📰 Wine 11 rewrites how Linux runs Windows games at the kernel level, and the speed gains are massive Wine 11 is the biggest jump for Linux gaming in years. 🔗 Source: https://www.xda-developers.com/wine-11-rewrites-linux-runs-windows-games-speed-gains/ #linux#kernel

Linuxgram 🐧

@linuxgram · Post #18147 · 22.03.2026 г., 22:53

📰 Linux 7.0-rc5 Released: Linux 7.0 "Starting To Calm Down" Linus Torvalds just issued Linux 7.0-rc5 as we inch toward the stable Linux 7.0 kernel release in April... 🔗 Source: https://www.phoronix.com/news/Linux-7.0-rc5-Released #kernel#linux

Linuxgram 🐧

@linuxgram · Post #18120 · 20.03.2026 г., 09:54

📰Sashiko: AI code review system for the Linux kernel spots bugs humans miss Beats getting roasted on the mailing list AI is coming to the Linux kernel in the form of a code review system - not code submissions.… 🔗 Source: https://go.theregister.com/feed/www.theregister.com/2026/03/20/sashiko_code_review_linux/ #kernel#linux

Linuxgram 🐧

@linuxgram · Post #18104 · 18.03.2026 г., 14:48

📰 Linux MGLRU Improvements Net A 30% Increase For MongoDB, More Than 100% On HDDs It's been a while since having any improvements to talk about for the MGLRU multi-gen LRU functionality for the Linux kernel to optimize page reclamation and help with system performance especially when enduring memory pressure. But this week a Tencent engineer posted some very promising patches for further enhancing this kernel feature... 🔗 Source: https://www.phoronix.com/news/Linux-MGLRU-30p-MongoDB #linux#kernel

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