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

Пребарај: #hacktoberfest2025

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

@githubtrending · Post #15299 · 12.11.2025 г., 15:00

#python#agent#ai#aiagent#awesome#chatgpt#hacktoberfest#hacktoberfest2025#llm#long_short_term_memory#memori_ai#memory#memory_management#python#rag#state_management Memori is an open-source memory engine that gives AI language models human-like memory using standard SQL databases like PostgreSQL, MySQL, or SQLite.[1][2] With just one line of code, you can enable any LLM to remember conversations, learn from interactions, and maintain context across sessions.[1] The key benefits are significant cost savings of 80-90% compared to expensive vector databases, complete data ownership and transparency since memories are stored in SQL databases you control, and zero vendor lock-in allowing you to export and move your data anywhere.[1][3] Memori works with popular frameworks like OpenAI, Anthropic, and LangChain, making it easy to integrate into existing projects without complex setup.[1] https://github.com/GibsonAI/Memori

GitHub Trends

@githubtrending · Post #15474 · 07.02.2026 г., 11:30

#javascript#android#genymobile#gnirehtet#gui#hacktoberfest#hacktoberfest2025#hacktoberfest2026#linux#macos#mirroring#recording#scrcpy#scrcpy_engine#scrcpy_gui#screensharing#screenshots#windows Escrcpy lets you mirror and control your Android device on a computer with low-latency scrcpy tech, plus smart AI commands, multi-device management, wireless links, and automation. Install easily via releases or Homebrew on macOS. This helps you test apps, game smoothly on big screens, manage phones efficiently, and save time without rooting or ads—boosting productivity for developers, gamers, and users. https://github.com/viarotel-org/escrcpy