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

Резултати

Пронајдени 3 слични објави

Пребарај: #seamless

当前筛选 #seamless清除筛选
TokenPocket

@tokenpocket_channel · Post #1112 · 13.01.2024 г., 08:35

【TokenPocket Retweeted】 Retweeted TransitFinance : Unlimit Crypto is live🚀! Transit Buy goes global, unlocking infinite crypto possibilities! 🚀#Transit#Buy is now integrated with Unlimit Crypto ​unlimit_crypto, providing crypto on-ramp support to hundreds of thousands of users globally. Transit Buy spans the global entry points for #fiat and #cryptocurrency, ensuring #seamless access for you! #Crypto#TransitBuy#UnlimitCrypto 【Details】https://twitter.com/TokenPocket_TP/status/1746088055679934633 【Powered By】Crypto Box

Venture Village Wall 🦄

@venturevillagewall · Post #3617 · 21.12.2024 г., 10:22

Skynet Raises $1.20M Skynet has successfully raised $1.20 million to enhance its platform, which aims to empower AI agents to connect seamlessly with global resources. For more information, visit Skynet. #Skynet#AI#Funding#Resources#Tech#Innovation#Investment#Global#Agents#Platform#Development#Seamless#Connect#Empower#Industry#Tools

GitHub Trends

@githubtrending · Post #15087 · 23.08.2025 г., 12:00

#shell#cassowary#docker#freerdp#gnome#hacktoberfest#integration#kde#libvirt#linux#linux_app#nautilus#nix_flake#podman#qemu#qemu_kvm#seamless#winapps#windows#wine#xfce You can run Windows applications like Microsoft Office and Adobe Creative Cloud directly on your Linux desktop (KDE, GNOME, or XFCE) as if they were native apps using WinApps. It works by running Windows inside a virtual machine (using Docker, Podman, or libvirt) and then showing Windows apps seamlessly on Linux with FreeRDP. Your Linux home folder is accessible in Windows, and you can right-click files in Linux to open them with Windows apps. This lets you use all Windows programs without leaving Linux, improving productivity and convenience without needing dual boot or separate hardware. https://github.com/winapps-org/winapps