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 слични објави

Пребарај: #optimize

当前筛选 #optimize清除筛选
BotsGram®

@botsgram_cu · Post #3269 · 09.12.2020 г., 13:12

@NewStickerOptimizerBot Qué puede hacer este bot? Simplemente envíeme una imagen o pegatina, y la convertiré en un archivo png y la optimizaré para que su tamaño sea más pequeño o igual a 350Kb, para que pueda agregarlo a un paquete de pegatinas usando el bot @stickers. Idioma: Inglés (visto en @BotsGram_cu) #sticker, #png, #image, #picture, #optimize, #pack, #create, #tool, #convert

GitHub Trends

@githubtrending · Post #15374 · 28.12.2025 г., 13:00

#shell#analyzer#appcleaner#clean#cleaner#cleaner_cli#cleaner_script#command_line#daisydisk#istat#mac#macos#optimize#sensei#shell#uninstall Mole is a free, open-source terminal tool that deeply cleans and optimizes your Mac by removing caches, logs, browser junk, and app leftovers—freeing up gigabytes like 95GB in one go. It smartly uninstalls apps with all hidden files, analyzes disk space visually, monitors CPU/memory live, and rebuilds caches for better speed. Install easily via curl or Homebrew, preview changes safely, and use Touch ID. This saves you money on paid cleaners, reclaims storage fast, boosts performance, and diagnoses issues simply from your terminal. https://github.com/tw93/Mole

GitHub Trends

@githubtrending · Post #14636 · 27.04.2025 г., 11:30

#powershell#automated#bloatware#bloatware_removal#cleanup#debloat#debloater#interactive#optimize#powershell#powershell_script#privacy#ps1#registry_tweaks#tweaks#windows#windows_10#windows_11#windows_11_debloat#windows10#windows11 Win11Debloat is a free PowerShell script that quickly removes pre-installed Windows bloatware like TikTok, Xbox Game Bar, and Copilot while disabling ads, telemetry, and intrusive features. It simplifies tasks like restoring the classic right-click menu, hiding duplicate drives in File Explorer, and removing taskbar clutter, saving you from manually adjusting settings. The script is safe, reversible, and improves your experience by eliminating unnecessary background processes and distractions, making Windows cleaner and more focused. https://github.com/Raphire/Win11Debloat