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

Резултати

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

Пребарај: #andes

当前筛选 #andes清除筛选
ЭТНОМОДА-СМЫСЛЫ

@etnomoda · Post #2595 · 17.09.2023 г., 17:33

Образы от @ carolinakuniverse portraits for Andes, the Fall/Winter 23 Коллекция воплощена в жизнь благодаря сотрудничеству латиноамериканских художников, это дань уважения богатой палитре латиноамериканской культуры. #ANDES Фото @ andresoyuela Стилист@ davidechikm Прическа и макияж @ laupantoja #nationaltrend

Interesting Planet 🌍

@interesting_planet_facts · Post #1278 · 06.02.2026 г., 22:11

🌎 In the Andes Mountains of Peru, the stone towers called chullpas remain a puzzle. Built by pre-Inca cultures, these cylindrical funerary monuments often stand in remote, windswept locations. Some chullpas are several meters tall and precisely constructed with blocks that fit together without mortar. ✨ #archaeology⚡#mystery⚡#Andes 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #552 · 13.08.2025 г., 13:22

🌎 The mountain tapir, native to the Andes, sports a thick woolly coat—unusual for tapirs. This adaptation lets it survive chilly cloud forests and high-altitude grasslands where temperatures often drop near freezing. ✨ #mammals⚡#adaptation⚡#Andes 👉subscribe Interesting Planet

Interesting Planet 🌍

@interesting_planet_facts · Post #1339 · 13.03.2026 г., 12:11

🌎 In 1972, a plane carrying Uruguayan rugby players crashed in the Andes mountains. Survivors endured 72 days in freezing conditions by using the wreckage for shelter and rationing food. Eventually, they resorted to eating the bodies of those who died. Sixteen out of forty-five people survived until rescue teams arrived after two of them hiked for help. ✨ #survival⚡#Andes⚡#history 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1052 · 19.11.2025 г., 12:11

🌎 After his plane crashed in the Andes in 1972, Nando Parrado survived 72 days stranded in freezing mountains. He trekked for 10 days across rugged terrain with fellow survivor Roberto Canessa to find help, leading rescuers to the remaining members. The crash site was over 3,600 meters above sea level. ✨ #survival⚡#Andes⚡#history 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #390 · 22.07.2025 г., 22:22

🌎 In the high Andes, vizcacha rodents resemble rabbits but are actually closer relatives of chinchillas. Their thick fur and strong hind legs help them survive cold mountain cliffs, where they skillfully leap and sunbathe on rocks. ✨ #andes⚡#mammals⚡#evolution 👉subscribe Interesting Planet

Amazing Geography 🌍

@amazingeo · Post #296 · 25.09.2025 г., 18:31

🌍 The Sacred Valley of the Incas in Peru is a living cultural landscape where ancient terraced fields, traditional villages, and Inca ruins blend with striking Andean scenery. ✨ #heritage⚡#Andes⚡#agriculture⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #612 · 04.02.2026 г., 12:31

🌍 The Andes Mountains are home to over 100 active volcanoes, making them the longest continental volcanic chain on Earth—stretching for more than 7,000 kilometers along South America’s spine. ✨ #mountains⚡#volcanoes⚡#Andes⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #634 · 15.02.2026 г., 20:31

🌍 Nearly half of all quinoa grown worldwide comes from just two regions in the Andes Mountains of Bolivia and Peru, where unique high-altitude conditions make large-scale farming possible. ✨ #agriculture⚡#Andes⚡#crops⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1173 · 29.12.2025 г., 18:11

🌎 Deep in the Andes of Bolivia, the ancient site of Tiwanaku features massive stone gateways, carved blocks, and precise alignments with celestial events. Some stones weigh over 100 tons and were transported from quarries more than 10 kilometers away. ✨ #archaeology⚡#andes⚡#tiwanaku 👉subscribe Interesting Planet 👉more Channels ​

12
ПретходнаСтраница 1 од 2Следна