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

Пребарај: #permissions

当前筛选 #permissions清除筛选
djangoproject

@djangoproject · Post #440 · 13.09.2017 г., 14:50

Using the Django authentication system This document explains the usage of Django’s #authentication system in its default configuration. This configuration has evolved to serve the most common project needs, handling a reasonably wide range of tasks, and has a careful implementation of #passwords and #permissions. For projects where authentication needs differ from the default, #Django supports extensive extension and customization of authentication. https://docs.djangoproject.com/es/1.11/topics/auth/default/

djangoproject

@djangoproject · Post #441 · 13.09.2017 г., 14:56

User authentication in #Django Django comes with a user authentication system. It handles user #accounts, #groups, #permissions and #cookie-based user #sessions. This section of the documentation explains how the default implementation works out of the box, as well as how to extend and customize it to suit your project’s needs. https://docs.djangoproject.com/es/1.11/topics/auth/

GitHub Trends

@githubtrending · Post #14663 · 02.05.2025 г., 12:30

#python#agents#ai#ai_agents#api#developer_tools#function_calling#integration#llm#mcp#oauth2#open_source#permissions#tools ACI.dev is an open-source platform that helps build AI agents by providing easy access to over 600 tools. It simplifies authentication and tool integration, allowing AI agents to work with many services like Google Calendar and Slack without needing separate setups. This platform offers multi-tenant authentication, flexible access methods, and natural language permissions, making it easier to manage and secure AI agent capabilities. It's open-source and works with any framework, which means you can build AI agents without worrying about vendor lock-in. https://github.com/aipotheosis-labs/aci