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

Резултати

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

Пребарај: #tectonics

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

@amazingeo · Post #613 · 04.02.2026 г., 20:31

🌍 Some earthquake "swarms" can hit the same spot repeatedly over weeks or months, releasing energy in small bursts instead of one big quake—often in volcanic or tectonic hot zones. ✨ #earthquakes⚡#tectonics⚡#geology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #575 · 14.01.2026 г., 12:31

🌍 The planet’s largest earthquake ever measured—a magnitude 9.5—struck Chile in 1960. This event released so much energy it caused land to drop by up to two meters along the coast. ✨ #tectonics⚡#earthquakes⚡#geology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #534 · 24.12.2025 г., 20:31

🌍 One of the fastest-moving tectonic faults is in Turkey, with plates shifting up to 23 millimeters per year. This constant motion makes the region prone to frequent, sometimes devastating earthquakes. ✨ #tectonics⚡#earthquakes⚡#geology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #502 · 08.12.2025 г., 20:31

🌍 Some tectonic plate boundaries move so slowly they create “silent earthquakes”—huge shifts that happen over days or weeks, releasing energy without sudden shaking. ✨ #tectonics⚡#earthquakes⚡#geology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #234 · 14.09.2025 г., 09:12

🌍 Some large earthquakes can trigger aftershocks that last for months or even years. These smaller quakes are part of the Earth’s ongoing adjustment after a major tectonic shift. ✨ #tectonics⚡#earthquakes⚡#geology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #160 · 02.09.2025 г., 03:12

🌍 The strongest earthquakes ever recorded can move entire cities by several meters in seconds. In 2011, Japan’s coastline shifted east by up to 5 meters due to a massive plate boundary quake. ✨ #earthquakes⚡#tectonics⚡#geology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #122 · 26.08.2025 г., 20:12

🌍 The San Andreas Fault in California allows two massive tectonic plates to slip past each other. This boundary creeps a few centimeters each year but can unleash powerful earthquakes in sudden jolts. ✨ #tectonics⚡#earthquakes⚡#geology⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #466 · 20.11.2025 г., 20:31

🌍 The ring-shaped chain of volcanoes called the "Ring of Fire" circles the Pacific Ocean, hosting about 75% of all active volcanoes on Earth and causing frequent earthquakes and eruptions. ✨ #volcanoes⚡#mountains⚡#tectonics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #692 · 16.04.2026 г., 20:31

🌍 The Atlantic Ocean is growing wider each year as the Americas slowly drift apart from Europe and Africa, adding about 2.5 centimeters annually—roughly the speed fingernails grow. ✨ #continents⚡#oceans⚡#tectonics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #348 · 08.10.2025 г., 18:31

🌍 The Eurasian and North American continents are moving apart by about 2.5 centimeters every year along the Mid-Atlantic Ridge, slowly widening the Atlantic Ocean over millions of years. ✨ #continents⚡#oceans⚡#tectonics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #18 · 10.08.2025 г., 10:27

🌍 The lithosphere’s tectonic plates move slowly, but sometimes collide to form tall mountain ranges like the Himalayas, linking Earth's rocky shell to the atmosphere and biosphere. ✨ #lithosphere⚡#tectonics⚡#mountains⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍

Amazing Geography 🌍

@amazingeo · Post #194 · 07.09.2025 г., 16:12

🌍 The Himalayas are rising by about 5 millimeters each year as the Indian and Eurasian plates continue to collide. This ongoing uplift makes these mountains among the youngest and fastest-growing on Earth. ✨ #mountains⚡#Himalayas⚡#tectonics⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

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