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

Пребарај: #contact

当前筛选 #contact清除筛选

😄Contact ➖➖➖➖➖➖ 🔘Contact is a verb and means 'speak or write to someone' - often when someone wants to give or receive information. 🔜The doctor contacted me this morning to tell me the results of my tests. 🔜Please don't contact me with any more offers. 🔘Contact can also be used as a noun to talk about speaking or writing to someone. 🔘In contact with means 'speak or meet regularly'. 🔘Make contact means 'try to speak or write to someone after finding where someone is'. 🔘Lose contact means 'no longer communicate'. 🔜Stay in contact when you go away. 🔜After he left the city, I lost contact with him, but I'll try to make contact again if I find out his new address. 🔘Contact refers to a person who can help or give you information in work or socially. 🔜I have a contact at the company. Her name is Debbie. 🔜My contacts told me there's a job opening at the business. 🔘Contact as a noun refers to people whose names, numbers, and/or email addresses you have stored on your mobile phone. The list on your phone where you find this information is called contacts. 🔜I'll add you as a new contact on my phone. 🔜Look in my contacts. My brother's number is there. #Contact👨‍🏫@America ➖➖➖➖➖➖➖➖➖➖➖➖ 🆕 Crypto News @Money 😁 Crypto Game @Egame 🇺🇸 US News @America 🇯🇵 Japan News @Japan 🇦🇪 UAE News @Dubai ▶️ Popular Movies @Videos 😜 Best Funny Video @Funnys

Hashtags

dopingpong

@dopingram · Post #3162 · 03.08.2024 г., 06:58

«Лёгкий контакт», digital art, Doping Pong, 2001 Этот образ без преувеличения можно назвать классикой российского цифрового искусства. Предлагаем проследить преображение и эволюционные изменения, которые применили Doping Pong к этому сюжету на разных этапах творчества – от digital art до академической живописи. Легкий контакт - digital art, 2001 Легкий контакт (новая версия), digital art, 2005 Легкий контакт, бумага, пастель, 2015 год Легкий контакт, холст, акрил, 2018 год #dopingpong#ufo#space#love#alien#kiss#digitalart#russianart#light#contact