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

Резултати

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

Пребарај: #legends

当前筛选 #legends清除筛选
Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #39958 · 27.10.2025 г., 23:01

Today, exactly 100 years ago on the 28th of October 1925 the mask of Tutankhamun was discovered. There was a legend that those who disturbed the tomb would be cursed, soon after the discovery and disturbance of the tomb certain incidents in wich members of the team started dying made it seem that this legend was true. [read more here] @googlefactss#history#funfact#Egypt#legends

Interesting Planet 🌍

@interesting_planet_facts · Post #1319 · 27.02.2026 г., 12:11

🌎 The legend of Yamata no Orochi comes from ancient Japanese mythology and describes an enormous eight-headed, eight-tailed serpent defeated by the god Susanoo. According to the Kojiki and Nihon Shoki texts from the 8th century CE, Susanoo discovered the creature in Izumo Province and tricked it with sake before slaying it. Archaeological evidence indicates these texts are among Japan’s oldest written records. ✨ #mythology⚡#Japan⚡#legends 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #631 · 26.08.2025 г., 03:22

🌎 Ireland’s legend of the Salmon of Knowledge tells of a magical fish that granted wisdom to whoever tasted it. In Celtic mythology, eating this salmon gave the poet Fionn mac Cumhaill extraordinary wisdom, making him a great hero in Irish folklore. ✨ #mythology⚡#legends⚡#folklore 👉subscribe Interesting Planet ​

Interesting Planet 🌍

@interesting_planet_facts · Post #922 · 17.10.2025 г., 12:11

🌎 On the island of Flores in Indonesia, local legend tells of the Ebu Gogo—small, hairy people said to steal food and mimic speech. In 2003, scientists discovered Homo floresiensis fossils nearby, a tiny ancient human species, fueling debate about whether the myth preserves a memory of real prehistoric encounters. ✨ #legends⚡#anthropology⚡#indonesia 👉subscribe Interesting Planet 👉more Channels ​

🗺🐍Grootslang (Afrikaans and Dutch for “big snake”) is a legendary creature said to dwell in a deep cave in the Richtersveld region of northwestern South Africa, fiercely guarding its diamonds 💎 from treasure seekers. According to myth, the Grootslang was so powerful and cunning that the gods who created Earth decided to split it into two separate species — the elephant🐘 and the snake. 🐍 Yet some Grootslangs, the legends say, escaped into the deepest cave, where they have survived to this day. The cave is filled with diamonds 💎, but no one can reach them — the creature keeps watch day and night. 🌑✨ #Culture#Myths#SouthAfrica#Africa#Legends#Wildlife

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40775 · 11.03.2026 г., 15:04

Flexible glass was a legendary type of glass from ancient Rome. A craftsman is said to have invented it, and it could supposedly bend without breaking. He showed it to Emperor Tiberius, who reportedly asked him to confirm he was the only one who knew how to make it. The emperor then had him executed to prevent the invention from spreading, an early example of planned obsolescence. No known examples survive today. 🏺🪞📜 [Read more] @googlefactss #FlexibleGlass#AncientRome#History#Legends#Innovation

Interesting Planet 🌍

@interesting_planet_facts · Post #757 · 15.09.2025 г., 20:22

🌎 The Mapuche people of southern Chile and Argentina have long told of the mythical “Pillán,” powerful spirits linked to volcanoes and natural disasters. Early European chroniclers in the 16th century recorded beliefs that eruptions were caused by these spirits’ anger. The word “pillán” still appears in many local place names near active volcanoes. ✨ #Mapuche⚡#mythology⚡#volcanoes⚡#legends 👉subscribe Interesting Planet ​

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