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

Пребарај: #modelsai

当前筛选 #modelsai清除筛选
Repositorio data science

@repo_science · Post #3240 · 29.05.2023 г., 15:22

#ChatGPT#modelsAI#freelancer 🤩 Make Money Freelancing with Chatpgpt - Step-by-Step Are you ready to take your freelancing business to the next level with the power of AI? Look no further than “Freelancing Business with AI & Chatgpt – Learn Step-by-step” – the comprehensive course designed to help you succeed in the world of online freelancing. In this course, you’ll learn proven step-by-step strategies for building a profitable freelancing business that harnesses the latest AI technologies. 🔗Link 🔐@repo_science ----- Main channel:@repo_science Coupons:@freecoupons_reposcience -----

Repositorio data science

@repo_science · Post #3241 · 29.05.2023 г., 15:54

#ChatGPT#modelsAI#freelancer#wordPress 🤩 Start Building Money Making Blog with ChatGPT & WordPress Are you interested in starting a blog but don’t know where to begin? Do you want to earn money while doing something you love? Look no further than WordPress, the most popular platform for creating and managing a blog. In this comprehensive course, we’ll guide you through the process of setting up a WordPress blog and show you how to turn it into a money-making machine. Our course, “Start Free Money Making Blogging with ChatGPT & WordPress,” is designed for beginners who want to learn the ins and outs of blogging with WordPress. With over 40% of all websites on the internet using WordPress, it’s clear that this platform is the best choice for creating a successful blog. 🔗Link ----- Main channel:@repo_science Coupons:@freecoupons_reposcience -----