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

Пребарај: #c4ca

当前筛选 #c4ca清除筛选
EU in Kazakhstan 🇪🇺🇰🇿

@euinkazakhstan · Post #1766 · 26.03.2026 г., 06:26

Operations Steering Committee of the EU Global Gateway’s Connectivity for Central Asia #C4CA project brought together consortium partners from Lithuania (CPVA), Latvia (CFCA), Estonia (EGA), Finland (HAUS), and France (Expertise France) in Bishkek, alongside the EU Delegations of Kazakhstan and Kyrgyzstan. As part of the Soft Pillar of the Team Europe Initiative on Digital Connectivity, the meeting reviewed first-year results and outlined priorities for the next phase, focusing on digital connectivity, digital economy development, and reducing connectivity gaps in Central Asia. The project delivered key outputs, including country assessments, digital ecosystem mapping, regional events during ICT Week in Uzbekistan and Digital Bridge, and study visits to Europe, Lithuania, and Finland on cybersecurity and the aerospace sector, in coordination with Central Asian stakeholders.

Hashtags

EU in Kazakhstan 🇪🇺🇰🇿

@euinkazakhstan · Post #1632 · 21.11.2025 г., 08:55

SpaceLab at Space Tech Forum, Germany 🚀 From 18–20 November 2025, SpaceLab represented Central Asia at the Space Tech Forum in Bremen, Germany, with support from the EU’s Global Gateway Connectivity for Central Asia – Soft Pillar program. At one of Europe’s largest space tech and aerospace events, SpaceLab established new contacts in the European space market, raised awareness of Central Asian innovative services among European industry players, and helped spark interest in the region on the international stage. The participation also contributed to strengthening cooperation between the #EuropeanUnion and #CentralAsia in the space sector and helped position SpaceLab and the broader Central Asian space community as a credible emerging player in the 🌍global space ecosystem. #SpaceTechForum#GlobalGateway#C4CA#EU4CA