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 #18467 · 17.04.2026 г., 07:55

📰 Russian Baikal CPUs Are Losing Their Place in the Linux Kernel After sanctions, bankruptcy and removal of kernel maintainers, Baikal's unfinished kernel code is being removed. 🔗 Source: https://feed.itsfoss.com/link/24361/17320657/linux-kernel-baikal-cpu-support-removal #kernel#linux

Linuxgram 🐧

@linuxgram · Post #18453 · 16.04.2026 г., 00:42

📰 WQ_AFFN_CACHE_SHARD Merged For Linux 7.1: Significant Win For CPUs With Many Cores Per LLC The workqueue changes merged today for the Linux 7.1 kernel are significant for today's modern high-end processors where there can be many CPU cores per last level cache (LLC / L3 cache). The new WQ_AFFN_CACHE_SHARD affinity scope can reduce some contention on such systems and help achieve greater performance... 🔗 Source: https://www.phoronix.com/news/Linux-7.1-WQ #kernel#linux

Linuxgram 🐧

@linuxgram · Post #18437 · 14.04.2026 г., 21:12

📰 LLM-Assisted Patches For Linux 7.1 May Have Negative Impact On 32-bit Systems Code now merged for the Linux 7.1 kernel may provide some negative performance implications for those still running modern Linux kernels on 32-bit hardware. A fundamental change can present cache line alignment and slab sizing implications for 32-bit Linux OS users but will provide for cleaner code with modern 64-bit computing... 🔗 Source: https://www.phoronix.com/news/Linux-7.1-VFS-Kino-32-bit #kernel#linux

Linuxgram 🐧

@linuxgram · Post #18418 · 13.04.2026 г., 16:32

📰 Rust For Linux 7.1 Bringing Experimental Option That Can Help Performance In advance of the Linux 7.1 merge window opening, Miguel Ojeda sent out all of the Rust feature updates on Friday. This includes bumping the minimum Rust version for building the Linux kernel as well as a new experimental option that can provide better performance for Rust code within the kernel, alongside other updates... 🔗 Source: https://www.phoronix.com/news/Linux-7.1-Rust #kernel#linux

Linuxgram 🐧

@linuxgram · Post #18413 · 13.04.2026 г., 12:54

📰Linux's Power Sequencing PCIe M.2 Driver To Support M.2 Key-E Connectors Merged for the Linux 7.0 kernel was a power sequencing driver for PCIe M.2 connectors as part of an effort to allow describing PCIe M.2 connectors in Device Tree files. For Linux 7.1, that driver is extending support for PCIe M.2 Key E connectors... 🔗 Source: https://www.phoronix.com/news/Linux-7.1-Power-Sequencing #kernel#linux

Linuxgram 🐧

@linuxgram · Post #18406 · 12.04.2026 г., 21:38

📰 Linux Kernel 7.0 Officially Released, This Is What’s New Linux kernel 7.0 is now available for download with new features, enhanced hardware support through new and updated drivers, improvements to filesystems and networking, and much more. 🔗 Source: https://9to5linux.com/linux-kernel-7-0-officially-released-this-is-whats-new #kernel#linux

Linuxgram 🐧

@linuxgram · Post #18405 · 12.04.2026 г., 19:53

📰 Linux Out-Of-Bounds Access Fixed For Unprivileged Users With Specially Crafted Certs An out-of-bounds access within the Linux kernel has existed in mainline the past three years that could be exploited by an unprivileged user submitting a specially crafted certificate to the kernel... 🔗 Source: https://www.phoronix.com/news/Linux-OOB-Special-Certificate #kernel#linux

Linuxgram 🐧

@linuxgram · Post #18400 · 12.04.2026 г., 05:27

📰 The Linux kernel now allows AI-written code, but you're on the hook for it In a world where AI code is entrenched within people's workflows, developers of all walks of life have had to draw a line somewhere. Some places will outright ban AI code, while others will fully embrace it, and each side has its advantages and disadvantages. Well, it turns out that the world of Linux has finally agreed upon where AI code fits within kernel development. Turns out, it's totally fine if you submit AI-generated code to the kernel;... 🔗 Source: https://www.xda-developers.com/linux-kernel-now-allows-ai-written-code/ #kernel#linux

Linuxgram 🐧

@linuxgram · Post #18389 · 10.04.2026 г., 21:03

📰After one of its choppiest preview cycles in years, Linux 7.0 is almost ready Linux 7.0's kernel hasn't had the best of release candidate phases. From the get-go, the release candidates showed more commit activity than usual, which sounds like it should be a good thing, but it really isn't. The release candidates aren't where new features get added; it's where features that have been added undergo testing. Therefore, the more activity a build has, the buggier it is. 🔗 Source: https://www.xda-developers.com/after-one-of-its-choppiest-preview-cycles-in-years-linux-70-is-almost-ready/ #kernel#linux

Linuxgram 🐧

@linuxgram · Post #18386 · 10.04.2026 г., 18:50

📰 VUMFAT File-System Driver Proposed For The Linux Kernel The newest Linux file-system driver proposed for the kernel is... VUMFAT... 🔗 Source: https://www.phoronix.com/news/Linux-VUMFAT-2026 #kernel#linux

Linuxgram 🐧

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

📰 Linux 2026 "Spring Cleaning" To Address Some Code Remnants As Far Back As Linux v0.1 A big kernel patch series was posted today by longtime Linux developer Thomas Gleixner. The set of 38 patches amount to some big time "spring cleaning" with addressing some code remnants still around that originated back in the very early Linux v0.1 kernel while some other code being cleaned up dates back to the Linux 1.3~2.1 kernel series from the 90's... 🔗 Source: https://www.phoronix.com/news/Linux-0.1-LATCH-Cleanup-2026 #kernel#linux

Linuxgram 🐧

@linuxgram · Post #18381 · 10.04.2026 г., 16:40

📰 Is a Clanker Being Used to Carry Out AI Fuzzing in the Linux Kernel? Greg Kroah-Hartman appears to be running AI-assisted fuzzing on the kernel. Don't outrage yet, as this may not be a bad thing. 🔗 Source: https://feed.itsfoss.com/link/24361/17316958/linux-kernel-ai-fuzzing #kernel#linux

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