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

Пребарај: #novitec

当前筛选 #novitec清除筛选
Auto Life

@revheadcrypto · Post #219 · 01.08.2024 г., 17:50

🚗✨Fostla Transforms the Ferrari Roma!✨🚗 The German atelier Fostla has taken the stunning Ferrari Roma to the next level! 🔥 🔧Upgrades Include: - Lowered chassis by 35mm with new Novitec springs 🌟 - Sleek matte wrap for a head-turning look 🎨 - Carbon rear spoiler for that sporty edge 🏎️ - Vossen NF11 wheels: 21 inches in the front and 22 inches in the back! 🛞 💥Power Boost: The factory 3.9L V8 engine delivers a robust 630 hp and 760 Nm. With Novitec's custom ECU and exhaust system, it can unleash an impressive 704 hp and 882 Nm! ⚡️ This transformation is not just about looks; it’s about performance! 💪 #FerrariRoma#Fostla#Novitec#CarTransformation#LuxuryCars#Supercars#Auto🏁

Auto Life

@revheadcrypto · Post #140 · 20.07.2024 г., 18:39

🏎️ McLaren Artura gets a massive wing and body kit by Novitec Novitec has added a giant wing mounted on pylons, along with a body kit, redesigned bumpers, and a new engine cover, all made of carbon fiber. The exhaust system can be crafted from stainless steel or Inconel, with an option for a gold coating at extra cost. Not only does it enhance the engine's sound, but it also boosts its performance by an estimated 35 horsepower, according to the tuners. #McLarenArtura#Novitec#carbonfiber#exhaustsystem#tuning#horsepowerboost