@trading_pit_signal · Post #34124 · 08.02.2024 г., 14:42
Remember to share team keep motivating. #Screenshot those Blue blizzards we going for more TP's MORE FEEDBACK MORE SIGNALS
Hashtags
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
Пребарај: #screenshot
@trading_pit_signal · Post #34124 · 08.02.2024 г., 14:42
Remember to share team keep motivating. #Screenshot those Blue blizzards we going for more TP's MORE FEEDBACK MORE SIGNALS
Hashtags
@trading_pit_signal · Post #33919 · 06.02.2024 г., 07:21
Remember to share FEEDBACK team keep motivating. #Screenshot those Blue blizzards we going for more TP's MORE FEEDBACK MORE SIGNALS
Hashtags
@trading_pit_signal · Post #33602 · 31.01.2024 г., 14:14
You can see gold🔥 and currency pairs 🔥 This is how it's done guys. #Screenshot your profit and send to admin. Click on the pinned message and contact admin
Hashtags
@trading_pit_signal · Post #33601 · 31.01.2024 г., 14:14
You can see gold🔥 and currency pairs 🔥 This is how it's done guys. #Screenshot your profit and send to admin. Click on the pinned message and contact admin
Hashtags
@trading_pit_signal · Post #33599 · 31.01.2024 г., 14:13
You can see gold🔥 and currency pairs 🔥 This is how it's done guys. #Screenshot your profit and send to admin. Click on the pinned message and contact admin
Hashtags
@trading_pit_signal · Post #33598 · 31.01.2024 г., 14:07
Remember to share FEEDBACK team keep motivating. #Screenshot those Blue blizzards we going for more TP's MORE FEEDBACK MORE SIGNALS
Hashtags
@trading_pit_signal · Post #33552 · 31.01.2024 г., 08:59
You can see gold🔥 and currency pairs 🔥 This is how it's done guys. #Screenshot your profit and send to admin. Click on the pinned message and contact admin
Hashtags
@trading_pit_signal · Post #33550 · 31.01.2024 г., 08:56
You can see gold🔥 and currency pairs 🔥 This is how it's done guys. #Screenshot your profit and send to admin. Click on the pinned message and contact admin
Hashtags
@trading_pit_signal · Post #33537 · 31.01.2024 г., 07:38
Remember to share FEEDBACK team keep motivating. #Screenshot those Blue blizzards we going for more TP's MORE FEEDBACK MORE SIGNALS
Hashtags
@trading_pit_signal · Post #33493 · 30.01.2024 г., 12:53
You can see gold🔥 and currency pairs 🔥 This is how it's done guys. #Screenshot your profit and send to admin. Click on the pinned message and contact admin
Hashtags
@trading_pit_signal · Post #33491 · 30.01.2024 г., 12:52
You can see gold🔥 and currency pairs 🔥 This is how it's done guys. #Screenshot your profit and send to admin. Click on the pinned message and contact admin
Hashtags
@trading_pit_signal · Post #33487 · 30.01.2024 г., 12:45
Remember to share team keep motivating. #Screenshot those Blue blizzards we going for more TP's MORE FEEDBACK MORE SIGNALS
Hashtags