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 #18382 · 10.04.2026 г., 16:54

📰 Framework tease new hardware and something big for Linux too Framework's " Event" is coming on April 21 where we expect new hardware announcements, and it looks like something big for Linux too.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/04/framework-tease-new-hardware-and-it-seems-something-linux-related-too/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18379 · 10.04.2026 г., 13:29

📰 Bazzite Linux gets some major upgrades for the April 2026 Update Bazzite Linux is easily one of the most popular gaming-focused Linux builds to run on handhelds and gaming PCs, with a major new update launched.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/04/bazzite-linux-gets-some-major-upgrades-for-the-april-2026-update/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18375 · 10.04.2026 г., 12:22

📰 Framework Computer To Announce Their Next-Gen Hardware Later This Month Linux-friendly hardware vendor Framework Computer sent out a notice this morning that they will be announcing their new 2026 hardware products later this month... 🔗 Source: https://www.phoronix.com/news/Framework-2026-Hardware #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18363 · 09.04.2026 г., 09:39

📰PipeWire 1.6.3 Improves RAOP Compatibility to Make It Work on More Devices PipeWire 1.6.3 audio/video server for Linux is now available for downlaod with audio mixer optimizations and various bug fixes. 🔗 Source: https://9to5linux.com/pipewire-1-6-3-improves-raop-compatibility-to-make-it-work-on-more-devices #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18357 · 08.04.2026 г., 20:54

📰Bazzite is chopping 1GB off its image size—here's what got cut It has never been a better time to be a Linux gamer. With Proton making good headway, we're seeing gaming-oriented distros spring up in the wake of SteamOS to capitalize on the wave of titles Linux can now run. This includes Bazzite, which has posted some excellent performance demonstrations over the past few months, including that one time it outperformed Windows on Microsoft's branded handheld console. 🔗 Source: https://www.xda-developers.com/bazzite-chopping-1gb-off-its-image-size/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18325 · 06.04.2026 г., 15:20

📰 Multi-OS Cyberattacks: How SOCs Close a Critical Risk in 3 Steps Your attack surface no longer lives on one operating system, and neither do the campaigns targeting it. In enterprise environments, attackers move across Windows endpoints, executive MacBooks, Linux infrastructure, and mobile devices, taking advantage of the fact that many SOC workflows are still fragmented by platform. For security leaders, this creates a. 🔗 Source: https://thehackernews.com/2026/04/multi-os-cyberattacks-how-socs-close.html #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18321 · 06.04.2026 г., 11:44

📰 hid-omg-detect: Linux Driver In Development To Detect Malicious HID Devices Zubeyr Almaho has been leading work on a new HID driver named hid-omg-detect with an intent on passive monitoring to watch out for any malicious HID devices being connected to the system... 🔗 Source: https://www.phoronix.com/news/hid-omg-detect-Malicious-HID #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18315 · 04.04.2026 г., 21:57

📰 The best thing about modern Linux isn't the desktop, it's how easy it is to roll back your mistakes When I made the move from Windows to Linux, I wasn't quite sure what to expect. I knew I was moving into a whole new ecosystem, and I had an idea as to what I wanted to test out, but other than that, I had no idea what I was getting into. So, I just sort of jumped in and gave Linux a try. 🔗 Source: https://www.xda-developers.com/best-thing-about-modern-linux-rollback-your-mistakes/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18296 · 03.04.2026 г., 13:41

📰 When a billboard survives the wind, but not the boot This GRUB is not an advert for some tasty fried food Bork!Bork!Bork! It's one thing to bare your undercarriage in private. It's a whole other thing to do so on the side of a road, risking the possibility that passing drivers will question your Linux competence.… 🔗 Source: https://go.theregister.com/feed/www.theregister.com/2026/04/03/when_a_billboard_survives_the/ #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18295 · 03.04.2026 г., 13:25

📰 Snapdragon X2's Adreno X2-85 GPU Sees Driver Improvements For Linux 7.1 Rob Clark on Thursday sent out the batch of MSM DRM driver feature changes targeting the upcoming Linux 7.1 merge window. This new work for DRM-Next includes enhancements to the Adreno X2-85 GPU support as found within the new Snapdragon X2 laptop SoCs plus various enhancements to existing Qualcomm graphics/display hardware... 🔗 Source: https://www.phoronix.com/news/Linux-7.1-Qualcomm-MSM #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18294 · 03.04.2026 г., 13:09

📰 FreeBSD Laptop Project Hopes To Port Newer Linux Graphics Drivers This Year Developers working on the FreeBSD laptop initiative to make the FreeBSD operating system more suitable for running on modern laptop hardware have drafted their road-map of further action items they hope to accomplish in 2026... 🔗 Source: https://www.phoronix.com/news/FreeBSD-Newer-GPU-Drivers-2026 #linux

Hashtags

Linuxgram 🐧

@linuxgram · Post #18277 · 02.04.2026 г., 06:21

📰 Running Mainline Linux, U-Boot, and Mesa on Rockchip: A year in review Get the recap of Nicolas Frattaroli's FOSDEM talk detailing Rockchip’s mainline progress, including Vulkan 1.4 and NPU support as a vital path to sustainable, affordable hardware. 🔗 Source: https://www.collabora.com/news-and-blog/blog/2026/03/02/running-mainline-linux-u-boot-and-mesa-on-rockchip-a-year-in-review/ #linux

Hashtags

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