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

Резултати

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

Пребарај: #africatech

当前筛选 #africatech清除筛选

🚀ETHIOPIA GOES DIGITAL: ADDIS ABABA LAUNCHES SCOOTER SHARING! ኢትዮጵያ ወደ ዲጂታል ይሄዳል፡ አዲስ አበባ የስኪቴር ማጋራት ጀምራለች! 💫ADDIS BIKE - THE FUTURE IS HERE: • First electric scooter sharing in Horn of Africa! 🌍 • Digital registration through Ethiopian national ID • Bole Avenue route: Meskel Square → Airport 🛩️ • Speed limit: 20 km/h for safety • Cost: 5 birr/minute, 300 birr/hour ($2 USD) 🎯YOUTH REVOLUTION: Ethiopian millennials are embracing smart mobility! From ancient coffee ceremonies to modern app-based transport - this is how traditions meet innovation! 🚴‍♀️INFRASTRUCTURE READY: Dedicated bike lanes, proper equipment, safety first approach - Addis Ababa is building smart city infrastructure! 💻ETHIOPIA'S TECH BOOM: • IceAddis - leading tech hub and startup incubator • Growing fintech sector with mobile banking solutions • Government digitalization initiatives • Young developers creating apps for African market • 5G network rollout in major cities 🌐DIGITAL TRANSFORMATION: From traditional markets to digital payments - Ethiopia is building Africa's Silicon Valley in the heart of the continent! ✨SYMBOLIC MOMENT: From Lucy's first steps 3.2 million years ago to electric scooters today - Ethiopia continues to lead human mobility evolution in Africa! 🇪🇹 #EthiopiaDigital#AddisAbaba#SmartMobility#AfricaTech#ኢትዮጵያ🛴⚡📱

💻 FROM ANCIENT SCRIPTS TO DIGITAL CODE: ETHIOPIA'S TECH TAKEOVER 💻 ከጥንታዊ ጽሑፍ እስከ ዲጂታል ኮድ: የኢትዮጵያ ቴክኖሎጂ መቆጣጠር 🔥 КОГДА 3000-ЛЕТНЯЯ ЦИВИЛИЗАЦИЯ ВСТРЕЧАЕТ SILICON VALLEY! Ethiopian youth aren't just consuming technology - they're CREATING it! 💫 🌟 DIGITAL ETHIOPIA RISING: 🏙️ ADDIS ABABA = AFRICA'S SILICON VALLEY: - Tech hubs sprouting faster than coffee plants - Young developers coding the future of Africa - From ancient Ge'ez script to programming languages! 💡 ETHIOPIAN TECH STARTUPS CHANGING THE GAME: 🚀Ride - Ethiopia's answer to Uber, built for African roads 🚀ZayRide - Local mobility solutions that actually work 🚀Deliver Addis - Food delivery revolutionizing Ethiopian dining 🚀EthSwitch - Fintech making banking accessible to everyone 🚀Gebeya - Training Africa's next generation of developers 🚀iCog Labs - AI and robotics putting Ethiopia on the tech map 📊 THE NUMBERS DON'T LIE: ✨ 50%+ youth population = MASSIVE tech potential ✨ Growing internet penetration = Digital revolution in motion ✨ Government support for tech initiatives = Infrastructure backing innovation ✨ Ancient problem-solving culture + Modern tools = Unstoppable combination 🎯 YOUNG ETHIOPIAN DEVELOPERS SAY: *"Our ancestors built Lalibela without blueprints - we build apps without limits!"* *"ቅድመ አያቶቻችን ላሊበላን ያለ ንድፍ ገንብተዋል - እኛ ያለ ገደብ መተግበሪያዎችን እንገነባለን!"* 🔋 THE DIGITAL SWAG: - Coding in multiple languages (including Amharic interfaces!) - Building solutions for African problems - Connecting rural Ethiopia to global markets - Making ancient wisdom accessible through modern tech 🚀 PLOT TWIST: While Silicon Valley talks about "disruption," Ethiopia has been disrupting expectations for millennia! 💪 THE FUTURE IS BEING WRITTEN: In Ethiopian coffee shops, young developers are coding solutions that will change Africa forever! *From coffee ceremonies to coding ceremonies - the grind never stops* ☕💻 #DigitalEthiopia#የኢትዮጵያቴክኖሎጂ#EthiopianTech#AfricaTech#TechStartups#DigitalRevolution#EthiopianInnovation#TechHub#ኢትዮጵያላይፍ#FutureIsEthiopian