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

Резултати

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

Пребарај: #actions

当前筛选 #actions清除筛选
科技&趣闻&杂记

@kejiqu · Post #3685 · 06.08.2025 г., 01:46

新 AI 编程伙伴:Gemini CLI GitHub Actions 谷歌推出了 Gemini CLI GitHub Actions,这是一个免费的 AI 编程工具,用于 GitHub 代码库。 该工具可在代码库中执行安全扫描、测试,并提供补丁建议。 Gemini CLI GitHub Actions 旨在作为关键流程的自主代理,旨在提高开发效率。该工具不收取任何费用。The Keyword 🏷#Gemini#CLI#GitHub#Actions#AI#编程 📢频道👥群组📝投稿

GitHub Trends

@githubtrending · Post #15481 · 09.02.2026 г., 11:30

#go#actions#cai#ci#claude_code#codex#copilot#gh_extension#github_actions GitHub Agentic Workflows let you write simple markdown instructions in natural language to automate repo tasks like triaging issues, fixing CI failures, generating reports, and improving code—running safely as GitHub Actions with AI like Copilot or Claude. Strong guardrails ensure read-only access by default, sandboxed execution, and human-reviewed outputs via pull requests. This saves you time on repetitive work, boosts efficiency with adaptive AI decisions, and keeps everything secure without complex YAML coding. https://github.com/github/gh-aw

GitHub Trends

@githubtrending · Post #15174 · 27.09.2025 г., 13:00

#typescript#actions#authentication#gcp#github_actions#google_cloud#google_cloud_platform#iam#identity#security You can securely connect GitHub Actions to Google Cloud using the Google GitHub Action called `auth`. It supports two main ways: the recommended Workload Identity Federation (WIF), which uses short-lived tokens and avoids long-lived service account keys, and the older Service Account Key JSON method. WIF improves security by creating a trust link between your GitHub workflow and Google Cloud without exposing permanent credentials. To use it, you set up a Workload Identity Pool and Provider in Google Cloud, then configure your GitHub workflow to authenticate with these. This lets your workflows access Google Cloud resources safely and easily, reducing risks and simplifying credential management. https://github.com/google-github-actions/auth