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

Резултати

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

Пребарај: #bookfair

当前筛选 #bookfair清除筛选
Venezuelanalysis

@venanalysis · Post #2026 · 09.07.2025 г., 19:42

📸 IN IMAGES | Venezuela Challenges Eurocentric Narratives in International Book Fair President Nicolás Maduro inaugurated the 21st edition of the Venezuelan International Book Fair (FILVEN), announcing a new initiative to distribute printed books in schools nationwide. The event, held in Caracas, features Egypt as the guest of honor, commemorating 75 years of diplomatic relations. With 18 publishers from 10 countries, FILVEN runs through July 13 before continuing across other Venezuelan states. Follow the link to check out our gallery: https://venezuelanalysis.com/images/venezuela-challenges-eurocentric-narratives-in-international-book-fair/ #BookFair#Culture

Venezuelanalysis

@venanalysis · Post #1659 · 22.07.2024 г., 22:21

Venezuela Honors South Africa at the 20th International Book Fair At Venezuela’s 20th International Book Fair, South Africa was honored with 18 authors, and Nelson Mandela’s legacy was celebrated. The event also featured Jorge Ramos Tolosa’s book on Palestine. Don’t miss out on the gallery by clicking here 👉🏼https://shorturl.at/PSCso #bookfair#filven#filven2024#venezuela

Green University CA | Official

@centralasian_greenuniversity · Post #601 · 27.12.2025 г., 13:02

📚Book Fair at Green University 📖A book fair was held at the university, bringing together students, faculty, and book lovers in a lively academic atmosphere. The event offered a wide selection of literature, encouraged reading culture, and created a space for meaningful exchange of ideas. #BookFair#ReadingCulture#StudentLife#LoveForBooks ✉️[email protected] ☎️ +998 55 512 00 77 📍Location 🌐Website | 📱Telegram | 📱Instagram | 📱LinkedIn | 🟥YouTube