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

Пребарај: #oci

当前筛选 #oci清除筛选
GitHub Trends

@githubtrending · Post #15595 · 01.04.2026 г., 11:30

#go#distribution_spec#helm#kubernetes#oci#oci_distribution#opencontainers#zot Zot is a lightweight, production-ready OCI-native container registry for storing images, Helm charts, SBOMs, and other artifacts without vendor lock-in. It offers built-in authentication (OIDC, LDAP), storage options (S3, Azure), scanning, caching to cut Docker Hub limits/latency, and ARM/edge support as a single binary. You benefit by easily self-hosting a secure, scalable alternative to Docker Hub, saving costs, boosting speed, and enabling secret-less workflows on any device. https://github.com/project-zot/zot

GitHub Trends

@githubtrending · Post #14660 · 01.05.2025 г., 16:00

#go#containers#cyclonedx#docker#go#golang#hacktoberfest#oci#sbom#spdx#static_analysis#tool Syft is a tool that helps create a list of all the software components used in your applications, known as a Software Bill of Materials (SBOM). This list is important for finding vulnerabilities and ensuring that your software complies with licensing rules. By using Syft, you can better manage your software's security and compliance. It works with many types of software and can be used with other tools like Grype to check for vulnerabilities. This helps keep your software safe and up-to-date. https://github.com/anchore/syft