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 слични објави

Пребарај: #sergeylavrov

当前筛选 #sergeylavrov清除筛选

@RusEmbMalta Press Release 🇷🇺Interview of Russian Foreign Minister Sergey Lavrov with Turkish Media 📍Moscow, 29 January 2026 On 29 January 2026, Russian Foreign Minister Sergey Lavrov gave an interview to Turkish media, outlining Russia’s principled assessment of the situation around Ukraine, the role of the West, and the prospects for a sustainable security architecture. 🔹 Key points 🧭 Ukraine and the West Russia views the Ukrainian conflict as part of a broader confrontation with the West. Ukraine has been turned into a pawn – a tool used to build a military bulwark along Russia’s borders, creating direct threats to Russian security. 📜Breach of Ukraine’s founding principles Ukraine’s Declaration of Independence explicitly enshrined non-alignment, neutrality and renunciation of nuclear weapons. It was precisely these principles that formed the basis on which Russia – along with most countries worldwide – recognised Ukraine after the dissolution of the Soviet Union. 🔹A conflict prepared in advance The crisis in Ukraine was not spontaneous. It was carefully prepared and financed, including by the United States. As former US Deputy Secretary of State Victoria Nuland has acknowledged, around USD 5 billion was spent to engineer a coup and transform Ukraine into an “anti-Russia” project. ⚠️ A tragic repetition of history The Zelensky regime represents a grim repetition of history — not a farce, but a tragedy, given the immense human toll. Many lives have been sacrificed by the regime and its Western patrons. ⛔Ceasefire proposals Russia considers unacceptable the repeated calls by Zelensky for a ceasefire of 60 days or longer. Past experience shows that such pauses were consistently exploited to rearm Ukraine, mobilise new recruits by force, regroup troops and prolong the conflict. 🕊️Missed opportunity in Istanbul (April 2022) Concrete and honest security guarantees were formulated during negotiations in Istanbul, hosted by Türkiye. These included the absence of foreign military bases on Ukrainian territory and restrictions on military exercises involving external forces. Everything was agreed in detail – but the process was blocked after external political interference. 📄So-called “peace plans” Russia has not seen the “20-point plan” repeatedly referenced by Zelensky. As understood, it has since been reworked by Ukraine and certain European states and is now being promoted as an alternative “vision” of peace. 🌍Multipolar world Russia does not oppose states that firmly defend their national interests. On the contrary, a truly multipolar world can only emerge through self-respecting states guided by common sense — states that defend their own interests while respecting those of others. 🔗 Full text of the interview: 👉here. #RussiaTürkiye #SergeyLavrov #UkraineCrisis

ሰርጌይ ላቭሮቭ ለ130ኛው የዓድዋ ድል በዓል የእንኳን አደረሳችሁ መልዕክት አስተላለፉ ******************** የሩሲያ የውጭ ጉዳይ ሚኒስትር ሰርጌይ ላቭሮቭ ለኢፌዴሪ የውጭ ጉዳይ ሚኒስትር ጌድዮን ጢሞቴዎስ (ዶ/ር) እና ለመላው የኢትዮጵያ ሕዝብ ለ130ኛው የዓድዋ ድል በዓል የእንኳን አደረሳችሁ መልዕክት አስተላልፈዋል። የውጭ ጉዳይ ሚኒስትሩ በመልዕክታቸው፤ የዓድዋ ድል በአፍሪካ ታሪክ አንዲት ሀገር በቅኝ ገዥ ኃይል ላይ የተቀዳጀችው የመጀመሪያው ድል በመሆኑ በዓለም አቀፍ ደረጃ ከፍተኛ ተጽዕኖ የፈጠረ መሆኑን ገልጸዋል። ድሉ የኢትዮጵያውያንን የጽናት መንፈስ ከማረጋገጡ ባለፈ በመላው አፍሪካ ለሚካሄዱ የነፃነት ትግሎች መነሻ መሆኑንም አክለዋል። ሩሲያ እና ኢትዮጵያ ለረጅም ዘመናት የዘለቀ የወዳጅነት ታሪክ እንዳላቸው የጠቀሱት ሰርጌይ ላቭሮቭ፤ በየተለያዩ ዓለም አቀፍ ድርጅቶች በተለይም በተባበሩት መንግሥታት ድርጅት እና በብሪክስ ማዕቀፍ ውስጥ ፍትሃዊ የዓለም ሥርዓት እንዲኖር በጋራ እየሠሩ መሆኑን ጠቁመዋል። በተጨማሪም በሁለቱ ሀገራት መካከል በንግድ፣ በኢኮኖሚ፣ በሳይንስ እና በባህል ዘርፎች ትብብሮች እያደጉ መሆናቸውን መግለጻቸውን የሩሲያ የውጭ ጉዳይ ሚኒስቴር መረጃ አመልክቷል። በኢትዮጵያ የኒውክሌር ኃይል ማመንጫ ግንባታን ጨምሮ፣ የደጃዝማች ባልቻ ሆስፒታልን መልሶ መገንባት እና የጋራ ባዮሎጂካል ምርምር ማዕከል መመሥረት ዋና ዋናዎቹ የትብብር ፕሮጀክቶች መሆናቸውን ሚኒስትሩ በመልዕክታቸው ጠቅሰዋል። #EBC#Ethiopia#Russia#Adwa130#Diplomacy#SergeyLavrov#GedionTimotheos#BRICS