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

Резултати

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

Пребарај: #coastlines

当前筛选 #coastlines清除筛选
Amazing Geography 🌍

@amazingeo · Post #319 · 01.10.2025 г., 15:31

🌍 In some places, coastal cliffs are vanishing so quickly that entire villages have moved inland within a single generation, as sea level rise and stronger storms speed up the erosion. ✨ #erosion⚡#coastlines⚡#climate⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #72 · 18.08.2025 г., 16:12

🌍 The boundary where the Earth's solid land meets the sea—called the coastline—is constantly changing. Waves, tides, and storms reshape these edges every day, making coastlines dynamic and ever-shifting. ✨ #geography⚡#coastlines⚡#change⚡#nature⚡#earth 👉subscribe Amazing Geography🌍

Amazing Geography 🌍

@amazingeo · Post #472 · 23.11.2025 г., 20:31

🌍 Coastal erosion is eating away cliffs and beaches so fast in some places that detailed maps need updating every year, with new shorelines appearing and disappearing before our eyes. ✨ #coastlines⚡#erosion⚡#mapping⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #701 · 25.04.2026 г., 20:31

🌍 Coastal erosion now removes up to 24 square meters of land per meter of shoreline in some parts of West Africa each year, forcing whole fishing villages to move further inland. ✨ #coastlines⚡#erosion⚡#sea-level ⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #432 · 03.11.2025 г., 20:31

🌍 Satellite data shows that some coastlines have retreated by over 50 meters in just a decade, as rising sea levels and stronger storms rapidly reshape shores across the globe. ✨ #erosion⚡#sea-level ⚡#coastlines⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #431 · 03.11.2025 г., 12:31

🌍 The Mediterranean coastline holds more than 150 million-year-old fossils, often exposed in seaside cliffs by constant wave erosion. Some beach rocks here contain ancient traces of life dating back to the dinosaurs. ✨ #coastlines⚡#fossils⚡#erosion⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #49 · 14.08.2025 г., 20:12

🌍 Mangroves protect coastlines from storms and rising seas, but over a third have been lost worldwide. Their destruction leaves many regions more vulnerable to flooding and erosion. ✨ #mangroves⚡#coastlines⚡#erosion⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍

Amazing Geography 🌍

@amazingeo · Post #538 · 26.12.2025 г., 20:31

🌍 The Salar de Uyuni in Bolivia holds an ancient, dried-up sea that now forms the world's largest salt flat. Rare rainy seasons briefly transform it into a mirror reflecting the entire sky. ✨ #coastlines⚡#saltflat⚡#landscape⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #471 · 23.11.2025 г., 12:31

🌍 The Bohai Sea in China is so shallow that its average depth is just 18 meters—less than a six-story building. This makes it one of the least deep seas in the world’s coastal regions. ✨ #seas⚡#coastlines⚡#shallow⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​