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

Пребарај: #microservice

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

@githubtrending · Post #14904 · 03.07.2025 г., 12:00

#go#ai_assistant#ai_generated_code#cloud_native#code_generation#custom_templates#developer_tools#development_framework#gin#go_sponge#golang#grpc#grpc_gateway#low_code#microservice#protobuf#restful_api#sponge#web Sponge is a powerful Go development framework that helps you quickly build backend services like RESTful APIs and microservices with minimal coding. It generates modular Go code automatically by parsing SQL, Protobuf, and JSON files, letting you create complete backend projects through a simple web interface without complex commands. Sponge supports custom templates and integrates AI assistants (like ChatGPT) to help write business logic, greatly speeding up development and reducing repetitive work. It also offers full support for testing, API docs, and deployment, making your project more stable, efficient, and easier to maintain. This saves you time and improves code quality. https://github.com/go-dev-frame/sponge

GitHub Trends

@githubtrending · Post #14691 · 10.05.2025 г., 00:00

#csharp#architecture#aspnetcore#clean_architecture#cqrs#ddd#dotnet#dotnetcore#event_driven_architecture#event_sourcing#kubernetes#masstransit#messaging#microservice#microservices#oauth2#opentelemetry#software_architecture#software_design#software_engineering#vertical_slice_architecture Migrating from a monolithic architecture to a cloud-native microservices architecture offers several benefits. It improves scalability, allowing different parts of the application to grow independently. This approach also enhances reliability by isolating faults, so if one service fails, others continue to work. Additionally, microservices enable faster deployment and updates, as each service can be developed and deployed separately. This flexibility allows teams to use the best technology for each service, making development more efficient and agile[2][3][5]. https://github.com/meysamhadeli/monolith-to-cloud-architecture