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

Резултати

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

Пребарај: #socialism

当前筛选 #socialism清除筛选
Venezuelanalysis

@venanalysis · Post #2056 · 07.08.2025 г., 14:58

🎙🔊 PODCAST | The latest Venezuelanalysis episode discusses the role of communes in socialist construction and anti-imperialist struggles. Communes foster communal exchange over commodities and address racial and patriarchal oppression. Their impact, however, depends on integration into a broader anti-imperialist strategy in the global fight against imperialism, states guest Chris Gilbert. 👉 Watch the full episode here: https://www.youtube.com/watch?v=u0RyfxgQgfc&t=2s #Communes#Socialism

Venezuelanalysis

@venanalysis · Post #1594 · 08.06.2024 г., 20:56

Seasoned communard Ángel Prado takes over the Ministry of Communes as the Maduro government bets on funding local projects chosen by communities. Prado replaces Guy Vernáez and pledged to take on the challenge with "great commitment." https://venezuelanalysis.com/news/venezuela-maduro-appoints-el-maizals-angel-prado-minister-of-communes/ #Venezuela#Communes#Socialism

Venezuelanalysis

@venanalysis · Post #1547 · 29.04.2024 г., 01:50

"Independence, commune and socialism." This is the slogan of a Venezuelan organization that aims to bring together popular power collectives: the Communard Union. Find out all about this initiative that wants to push the construction of socialism as envisioned by revolutionary leader Hugo Chávez. Watch the video here: https://venezuelanalysis.com/video/venezuelas-communard-union-in-a-nutshell/ #Venezuela#Socialism#Communes

Venezuelanalysis

@venanalysis · Post #1755 · 25.09.2024 г., 22:52

Burning Questions Put to Shaman Rufino of Venezuela Venezuelan shaman Rufino, a Huottüja leader, reflects on the recent elections and the future of the Bolivarian Revolution, urging for equal distribution of resources across communities. “We, the Huottüja people, live in socialism, sharing and caring for the territory.” Read the full article here 👉🏼https://shorturl.at/h61oM #IndigenousPeoples#PresidentialElections2024#Socialism

Venezuelanalysis

@venanalysis · Post #2045 · 28.07.2025 г., 23:34

🗓️ MILESTONE | On July 28, we remember the birth of Hugo Chávez, born in 1954 in Sabaneta, Venezuela. A revolutionary leader who reshaped the nation’s political landscape, Chávez remains a defining figure in Latin American history and a lasting influence on global struggles for socialism, sovereignty, and social justice. 👉 Find out about his legacy in this infographic: https://venezuelanalysis.com/infographics/15574/ #HugoChavez#Socialism#Venezuela#LatinAmerica

蛋挞报

@Pincongessence · Post #2504 · 17.11.2021 г., 03:45

看到这楼的时候在想:“这大概不只是美国人才有的问题吧”。我自己经历过的教育似乎也对其他“主义”非常排斥。 如果可以理解偏见的成因,我们会有办法改善现状吗? #reddit#socialism#education#bias 来源:reddit

MessageInABottle

@mib_messageinabottle · Post #7065 · 08.08.2024 г., 21:37

What #Britain is witnessing is the beginning of Dark #Blairism. This is the final stage in the collapse of the country. 🇬🇧🪦🧵 The first iteration of Blairism was a happy-go-lucky affair. #Blair and co were #Marxists of a variety, but happy Marxists who rejected state #socialism and embraced #cultural radicalism - a new, freer society where different groups would live in harmony. ☘🌈❤️ But society rejected this vision. 😭 People had “biases” - a false consciousness of sorts, mostly amongst the uneducated #gammons and chuds. 🤮 They couldn’t get into #Oxbridge to study with Tony, so the state needed to be used to educate them..... 👏 Read More: https://threadreaderapp.com/thread/1821450407979167748.html