@Telegraher · Post #633 · 29.01.2023 г., 12:47
Hahaha, eat that! 1989 #JinPooh#freetibet#西藏独立运动#西藏独立
Hashtags
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
Пребарај: #jinpooh
@Telegraher · Post #633 · 29.01.2023 г., 12:47
Hahaha, eat that! 1989 #JinPooh#freetibet#西藏独立运动#西藏独立
Hashtags
@Telegraher · Post #519 · 26.07.2022 г., 20:55
Folks, some handy tips: • read comments before commenting • vanilla tg OR our fork also have "translate" button If you commenting w/o reading the discussion.. Well, go on reddit 😁 More details: post about Nekogram picked up from NekoX chat. Moar details: • Nekogram is a bitch who ban you for political reasons and opinions like 1989 #JinPooh#freetibet#西藏独立运动#西藏独立 . • NekoX can be a bitchie and ban you when you critic Durov or TG TOS but they always unban you, while i'm still banned in Nekogram chat (i was banned twice in both and forever in Nekogram). My political messages are still in NekoX chat 😎
Hashtags
@Telegraher · Post #516 · 23.07.2022 г., 08:55
Hallo folks, fond this stuff in NekoX chat: https://github.com/NekogramX/Nekogram - link is fuckedup by github probably (upd). Fake it or not?.. Well, nekogram assholes are banned me also for politic content: 1989 #JinPooh#freetibet#西藏独立运动#西藏独立 Here https://t.me/telegraher/74 And here https://t.me/telegraher/95 https://t.me/telegraher/97 Ban + wipe any forbidden in china content. Text translated by chinese guy from nekox chat, original messages are in our chat. P.S. NekoX are bitchies also, but a much less, they're just for TG's TOS & Durov, not the chinese Gov, thats important différence. FREETIBET !
Hashtags