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

Резултати

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

Пребарај: #labs

当前筛选 #labs清除筛选
@belajarnetworking

@belajarnetworking · Post #382 · 08.03.2017 г., 12:02

#labs[.pka] Part 1: Basic Networking - 1-1 Basic Configuration http://www.ranet.co.th/packetlab/ccna/NA-1-1-BasicConfig.pka - 1-2 IPv4 Addressing http://www.ranet.co.th/packetlab/ccna/NA-1-2-IPv4addressing.pka - 1-3 IPv6 Addressing http://www.ranet.co.th/packetlab/ccna/NA-1-3-IPv6addressing.pka Part 2: LAN Technology - 2-1 InterVLAN Routing http://www.ranet.co.th/packetlab/ccna/NA-2-1-InterVLAN.pka - 2-2 VTP http://www.ranet.co.th/packetlab/ccna/NA-2-2-VTP.pka - 2-3 STP http://www.ranet.co.th/packetlab/ccna/NA-2-3-STP.pka Part 3: WAN Technology - 3-1 PPP - PAP http://www.ranet.co.th/packetlab/ccna/NA-3-1-PPP-PAP.pka - 3-2 PPP - CHAP http://www.ranet.co.th/packetlab/ccna/NA-3-2-PPP-CHAP.pka - 3-3 Frame Relay - Multipoint http://www.ranet.co.th/packetlab/ccna/NA-3-3-FR-Multipoint.pka - 3-4 Frame Relay - Point-to-Point http://www.ranet.co.th/packetlab/ccna/NA-3-4-FR-P2P.pka Part 4: IP Routing and Services - 4-1 Static and Default Route http://www.ranet.co.th/packetlab/ccna/NA-4-1-Static-Default-Route.pka - 4-2 RIP http://www.ranet.co.th/packetlab/ccna/NA-4-2-RIP.pka - 4-3 OSPF http://www.ranet.co.th/packetlab/ccna/NA-4-3-OSPF.pka - 4-4 EIGRP http://www.ranet.co.th/packetlab/ccna/NA-4-4-EIGRP.pka - 4-5 Port Security http://www.ranet.co.th/packetlab/ccna/NA-4-5-PortSecurity.pka - 4-6 Access Control List http://www.ranet.co.th/packetlab/ccna/NA-4-6-AccessList.pka - 4-7 NAT http://www.ranet.co.th/packetlab/ccna/NA-4-7-NAT.pka - 4-8 VPN-IPsec http://www.ranet.co.th/packetlab/ccna/NA-4-8-VPN.pka - 4-9 DHCP http://www.ranet.co.th/packetlab/ccna/NA-4-9-DHCP.pka

Hashtags

@belajarnetworking

@belajarnetworking · Post #181 · 21.01.2017 г., 12:05

r e u p l o a d ‌ #labsCCNA Full Labs .pka "File activity labs yang saat ini sedang rutin dikerjakan, silakan di download. Ada 5 buah folder: dan ebook guide nya" Content: - I: Network Fundamentals - II: Routing Protocols and Concepts - III: LAN Switching and Wireless - IV: Accessing the WAN - ++ Completed Activities

Hashtags

Venture Village Wall 🦄

@venturevillagewall · Post #3381 · 18.12.2024 г., 12:09

Fight Disinformation with AI INAR .IA Labs & Technologies has raised $1.21M for its innovative SaaS platform aimed at automating the detection and verification of disinformation across online content. Scheduled to launch on December 18, 2024, this multimodal and multilingual tool is set to enhance online security and information integrity. More details can be found at TrueFlag. #Funding#Technology#AI#SaaS#Disinformation#Verification#OnlineSafety#Security#Innovation#Automation#Multimodal#Multilingual#Integrity#Content#Platform#Launch #2024 #INAR#TrueFlag#Labs

GitHub Trends

@githubtrending · Post #14895 · 02.07.2025 г., 12:00

#python#copilot#csharp#dotnet#github#github_copilot#github_copilot_chat#github_copilot_for_azure#github_copilot_free#github_copilot_training#javascript#lab#labs#microsoft#python#sql#tutorial#tutorial_code#tutorial_exercises#visual_studio_code#vscode GitHub Copilot’s new Agent Mode is a powerful AI coding partner that goes beyond just suggesting code—it can independently write, debug, and improve your code, handle complex workflows, and even fix its own mistakes automatically. It works with multiple programming languages and integrates with popular development tools, helping you save time on repetitive tasks like testing, deployment, and refactoring. By using natural language prompts, you can guide it to complete multi-step projects, making coding faster and easier whether you’re a beginner or an expert. This course teaches you how to fully use these features, boosting your productivity and coding skills. https://github.com/microsoft/Mastering-GitHub-Copilot-for-Paired-Programming