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

Резултати

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

Пребарај: #sast

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

@githubtrending · Post #14996 · 25.07.2025 г., 12:00

#ocaml#c#go#java#javascript#python#r2c#ruby#sast#semgrep#static_analysis#static_code_analysis#typescript Semgrep is a fast, open-source tool that scans your code to find bugs and security issues in over 30 programming languages. It works locally on your computer or in your build system, so your code stays private. Semgrep’s rules are easy to write and understand, helping you catch problems early in development, whether in your IDE, pre-commit checks, or CI/CD pipelines. For stronger security, the Semgrep AppSec Platform offers advanced analysis, AI-powered triage, and detailed fix guidance, reducing false alarms and helping developers fix issues quickly without slowing down. This improves code quality and security efficiently. https://github.com/semgrep/semgrep

GitHub Trends

@githubtrending · Post #15349 · 20.12.2025 г., 12:30

#python#ai#bug_detection#code_audit#code_quality#code_review#developer_tools#devsecops#google_gemini#llm#react#sast#security_scanner#supabase#typescript#vite#vulnerability_scanner#xai **DeepAudit** is an AI-powered code audit tool using multi-agent collaboration to deeply scan projects for vulnerabilities like SQL injection, XSS, and path traversal. Import code from GitHub/GitLab or paste snippets; agents plan, analyze with RAG knowledge, and verify issues via secure Docker sandbox PoCs, generating PDF reports with fix suggestions. Deploy easily with one Docker command, supports local Ollama models for privacy, and cuts traditional tools' high false positives. **You benefit** by automating secure audits like a pro hacker—saving time, reducing errors, ensuring real exploits are caught, and speeding safe releases without manual hassle. https://github.com/lintsinghua/DeepAudit