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

Резултати

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

Пребарај: #tides

当前筛选 #tides清除筛选
Bali News

@balinews · Post #81 · 09.06.2024 г., 10:59

🌊 Bali authorities warn of high tides 🌤 Bali's Meteorology, Climate and Geophysics Agency is warning of extreme weather conditions for several days. In particular, of extremely high tides on the southern coast of the island. ❌ The population and tourists are advised to temporarily refrain from bathing on the beach of Kuta. @BaliNews #weather#tides#Kuta

Interesting Planet 🌍

@interesting_planet_facts · Post #711 · 08.09.2025 г., 16:22

🌎 In Australia’s Kimberley region, the Horizontal Falls are created when huge tidal currents force seawater through narrow rock gorges, producing powerful, temporary waterfalls that appear to flow sideways. Tides here can rise over 10 meters, creating one of the world’s most unusual tidal phenomena. ✨ #tides⚡#waterfalls⚡#Australia 👉subscribe Interesting Planet ​

Amazing Geography 🌍

@amazingeo · Post #265 · 19.09.2025 г., 13:12

🌍 Earth’s tides are driven mostly by the Moon’s gravity, causing oceans to rise and fall all over the globe. These constant movements help mix ocean waters and shape coastal ecosystems. ✨ #tides⚡#ocean⚡#cycles⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #318 · 01.10.2025 г., 12:31

🌍 The Wadden Sea along Europe’s North Sea coast is the world’s largest tidal mudflat system. Twice daily, the sea retreats for kilometers, revealing vast sandbanks and rich habitats for millions of migratory birds. ✨ #coastline⚡#tides⚡#wildlife⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #617 · 06.02.2026 г., 20:31

🌍 The Bay of Fundy in eastern Canada experiences the highest tidal range on Earth—up to 16 meters between high and low tide. These extreme tides carve dramatic coastal cliffs and ever-changing mudflats. ✨ #tides⚡#coast⚡#landscape⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​