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

Пребарај: #russianclasses

当前筛选 #russianclasses清除筛选
Russian House Brussels-Europe

@rushousebrussels · Post #2116 · 02.10.2024 г., 06:32

Today we continue the topic of confusing emphases! You can find the previous post here. ❓And, as per our tradition, I have a question: What word pairs confused you the most when speaking Russian? Share your stories in the comments! 📸: Pavel Kuzmichev, OZ_Media, Lucy Lambriex, LauriPatterson, bymuratdeniz, David Wall, Westend61, Mariha-kitchen, stocknshares/Getty Images #russianclasses 🔔Russia Beyond

Russian House Brussels-Europe

@rushousebrussels · Post #2103 · 18.09.2024 г., 09:11

Let's learn the diminutive forms for animal names! тигр -> тигрёнок медведь -> медвежонок слон -> слонёнок курица -> цыплёнок лошадь -> жеребёнок ❓Would you like to have any of these as a pet? :) P.S. Catch more of my lessons on YouTube! #russianclasses

Russian House Brussels-Europe

@rushousebrussels · Post #2100 · 10.09.2024 г., 07:54

Привет! We already made blini and kvass - time for okroshka! You’ll find the exact amounts of the ingredients to use here. ❓Have you tried okroshka? And what would you like to cook for next time? 📷: Maria Afonina; Yulia Gusterina/Getty Images #russianclasses 🔔Russia Beyond

Привет, салют и здравствуйте! Today we'll learn 5 Russian greetings. Formal ones: 🇷🇺Здравствуйте! 🇬🇧Hello! 🇷🇺Приветствую! 🇬🇧Greetings! Informal: 🇷🇺Привет! 🇬🇧Hi! 🇷🇺Салют! 🇬🇧Salutations! (Literally: "firework!") Very informal and conversational: 🇷🇺Здорово! (pronounced as ‘здарова!’) 🇬🇧Hey/What's up! ❓Do you know other (unusual) Russian greetings? Drop them in the comments! P.s. watch more videos here! #russianclasses 🔔Russia Beyond

Russian House Brussels-Europe

@rushousebrussels · Post #2085 · 27.08.2024 г., 13:19

🔊Sound on ☕ please, repeat Привет! Tired of learning Russian? Great news for you today then: we have thousands of words that are similar to English ones! Let’s start with those relating to food! Notice that the pronunciation is not always similar, so watch out for those accents! Still, learning Russian versions of the words you already know is far easier than learning absolutely new ones 🙂 That’s not the end of the list! Do you have any more examples? Drop them down in the comments! 👇🏼 Credits: Westend61, Aleksandr Kuzmin, Martin Barraud, serggn, Chris Stein, Halfdark/Getty Images Sourse: Russia Beyond https://t.me/russiabeyond/8927 #russianclasses#russianbeyond#РусскийДом#RussianHouse#Образование#КРЯ#brussels#belgium#educationrussia#RussianHouseBrussels#russianlanguagecoursesbrussels#russianlanguage#learnrussian#studyrussian