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

Пребарај: #studentssuccess

当前筛选 #studentssuccess清除筛选
Andijan Development Center

@adceducate · Post #8253 · 12.03.2024 г., 13:25

We would like to share CEFR results from our MAIN branch, a.ka. home of real achievers 🥳🔥 Abrorbek Patiddinov B2/52 Nozimaxon Akbarova: B2/53 And Muhammadali Abdumalikov C1/65 Their teacher: Mr.Shermuhammad 🎉 Congratulations on their initial academic accomplishments!!! 🎉 And, we hope to see them get high results from IELTS, as well! We also would like to extend our gratitude to their teacher, Mr. Shermuhammad, for his tireless efforts to produce such results week in and week out! 🤝 To join our courses, call 742281121 #studentssuccess ADC - The Way To Knowledge

Andijan Development Center

@adceducate · Post #8141 · 11.01.2024 г., 12:21

We would like to share CEFR results from our MAIN branch, a.ka. home of real achievers 🥳🔥 So, here we go! Bexruz; B2/53 (L and R: 58) Shoxjahon; B2/58 (L 64 and Sp 66) Rahmonberdi; B2/54 (L 57 and Sp 56) Diyora; B2/61 (L 73 🥳 R 67 🔥) And Asliddin; C1/66 (L 70 and R 68) 🎉 Congratulations on their initial academic accomplishments!!! 🎉 And, we hope to see them get high results from IELTS, as well! We also would like to extend our gratitude to their teacher, Mr. Shermuhammad, for his tireless efforts to produce such results week in and week out! 🤝 To join our courses, call 742281121 #studentssuccess ADC - The Way To Knowledge

Andijan Development Center

@adceducate · Post #8251 · 11.03.2024 г., 12:46

YANA BIR BAND 7️⃣.0️⃣👑 🤜BAND 7.0🤜 LISTENING: 7.0 🚀 READING: 7.5 🤓 WRITING: 6.5✍️ SPEAKING: 7.0 🔥 Full Name: Charos Rustamova👑 Attempt: 1st ✨ With British Council Age: 16 🤯 Teacher: Mr. Shermuhammad (8.5) General English, working hard and choosing the right teacher are the key elements to success in IELTS🍸 #ieltsresult#studentssuccess#band70#mainoffice THINK IELTS, THINK ADC