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

Резултати

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

Пребарај: #cradleofhumanity

当前筛选 #cradleofhumanity清除筛选

## 🦴 LUCY: MEETING HUMANITY'S 3.2 MILLION YEAR OLD GRANDMOTHER ## 🦴 ሉሲ - የሰው ዘር እናት 🌍 Where human history began - literally! In Addis Ababa lies a treasure that connects every person on Earth - Lucy (Dinknesh), the 3.2 million year old fossil that rewrote human history! 💫 ## 🏛️ NATIONAL MUSEUM OF ETHIOPIA 📍LOCATION: King George VI Street, Addis Ababa 🕐HOURS: Tuesday-Sunday, 8:30 AM - 5:30 PM (Closed Mondays) 💵ENTRY FEE: - Foreigners: 100 ETB (~$1.80) - Ethiopians: 10 ETB - Photography: +50 ETB 📸PRO TIP: Visit weekday mornings (9-11 AM) for fewer crowds! ## 🦴 LUCY - DINKNESH (ድንቅነሽ) *"You are wonderful" in Amharic* ✨DISCOVERED: November 24, 1974, Afar Region ✨AGE: 3.2 million years old ✨SPECIES: Australopithecus afarensis ✨SIGNIFICANCE: 40% complete - most complete early human ancestor ever found! ✨HEIGHT: 1.1 meters - small but mighty! ## 🌟 WHY LUCY CHANGED EVERYTHING Lucy proved our ancestors walked upright BEFORE developing large brains! She literally rewrote anthropology textbooks! 📚 ## 🏛️ MUSEUM HIGHLIGHTS ✨ Lucy's iconic skeleton display ✨ Ancient royal crowns and thrones ✨ Emperor Haile Selassie's throne ✨ Traditional Orthodox Christian art ✨ Artifacts spanning 3 million years ## 💡 HOW TO GET THERE 📍 Taxi from Meskel Square: 15-20 min, ~150-200 ETB 📍 Walking from Piazza: 25 minutes 📍 Blue taxi: 10 ETB (ask for "National Museum") ## 🌍 LUCY'S STORY 🇷🇺 Soviet paleontologists collaborated with Ethiopian researchers in 1970s-80s, helping establish Ethiopia's paleontological research! 🌎 Lucy traveled to USA (2007-2013) where 3 million people visited! She safely returned home to Ethiopia! 🇪🇹 ## 🌟 FOR YOUNG ETHIOPIANS This is YOUR heritage! Lucy proves human history STARTED in Ethiopia! Let this inspire you to: ✨ Study paleontology & archaeology ✨ Become museum professionals ✨ Share Ethiopia's story globally ## 💫 THE MESSAGE Ethiopia isn't just beautiful landscapes - it's where HUMANITY began! Every person on Earth can trace ancestry back to Ethiopia! --- Visit Lucy. Know your heritage. Share your pride!🇪🇹❤️ *Where humanity's journey began, Ethiopia's future shines brightest!* ✨ #LucyEthiopia#ሉሲ#NationalMuseumEthiopia#AddisAbaba#CradleOfHumanity#EthiopianHeritage#Dinknesh#VisitEthiopia#EthiopianPride