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

Резултати

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

Пребарај: #tp6anni

当前筛选 #tp6anni清除筛选
TokenPocket

@tokenpocket_channel · Post #1325 · 16.04.2024 г., 07:14

🎇Happy #TP6Anni!! 💙Join our 6th Anniversary Celebration and win OVER $10,000 Rewards! Dive into👇 https://app.galxe.com/quest/TokenPocket/GCwbMtTHJW 💪We would like to express our gratitude to all TP users and partners, and we hope to work together with you in the future to create a new era of blockchain! ❤️Thank BitlayerLabs, MerlinSwap, cyclenetwork_GO, and TNA_Protocol for supporting the 1st round of the #TP6Anni celebration! Stay tuned for more!

Hashtags

TokenPocket

@tokenpocket_channel · Post #1336 · 07.05.2024 г., 09:27

💙Thanks to all the #TPFam who participated in the #TP6Anni celebration! 🏆Check if you are on the #TP6Anni Giveaway Winner List! 1️⃣ 50 BitlayerLabs Lucky Helmet NFT 👉https://docs.google.com/spreadsheets/d/1qjIkzt1_CM_LfNaoy4vVIrqSmB5hF4oAN5pIScYgeQM/edit#gid=0 2️⃣ $2,000 esMP token Giveaway 👉https://docs.google.com/spreadsheets/d/1tt_AiQmQYZk3EFS-6hEwTZFBI0iTcJDK6YD110TZeQU/edit#gid=0 3️⃣1,000 Piggy Boxes V3 Giveaway 👉https://docs.google.com/spreadsheets/d/1_Aj9cgq0SdyJHQjztl-TWGwHQb_NHgWIbaonwzSH7vA/edit#gid=0 4️⃣$3,000 $TNA and 50 Tapnames Whitelists Giveaway 👉https://docs.google.com/spreadsheets/d/1ZiCOS_nQ897Vj5p5TgoMi607hCCk2IILhwVn6-w-MjE/edit#gid=0 💙Thanks for your participation! If you have any questions, please join https://t.me/tokenPocket_en.

TokenPocket

@tokenpocket_channel · Post #1326 · 17.04.2024 г., 07:02

🎇Happy #TP6Anni!! 💙Join and win 50 BitlayerLabs Lucky Helmet NFT Whitelists Giveaway on Galxe! 👉https://app.galxe.com/quest/TokenPocket/GCddyth8TC 🟧Bitlayer Lucky Helmet is the official NFT launched by BitlayerLabs, a symbol of identity representing the contributions of builders in the Bitlayer community. #TP6Anni#TokenPocket#Bitlayer

TokenPocket

@tokenpocket_channel · Post #1332 · 26.04.2024 г., 08:04

🎇Happy #TP6Anni!! 💙Join and win $2000 esMP Tokens Giveaway on Galxe! 👉https://galxe.com/TokenPocket/campaign/GCyyEths19 🟧MerlinSwap stands as the 1# Decentralized Exchange in the #Bitcoin ecosystem, aimed to become the liquidity hub for BTC and Bitcoin eco-assets, including #BRC20, #BRC420 and native tokens across MerlinLayer2 Bitcoin layer2.