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

Пребарај: #bans

当前筛选 #bans清除筛选
News and Tips

@news_and_tips · Post #1005 · 25.03.2023 г., 12:58

The Norwegian Parliament Bans Telegram from Government Devices The Norwegian parliament (aka The Storting) banned the installation of Telegram (and TikTok) on government-owned devices that are connected to the government’s internal infrastructure. are not allowed to be installed on devices with access to the internal infrastructure. The decision was made after a recommendation from the NSM, The Ministry of Justice and Public Security. It is worth noting that The Ministry of Justice and Public Security initially mentioned Telegram as a “Russian-owned” app, but then rephrased it as “an app with a Russian origin”. They also advised to immediately remove the apps on devices that have them installed. #bans Source : 💌

Hashtags

Venture Village Wall 🦄

@venturevillagewall · Post #4071 · 05.02.2025 г., 07:00

NBU Accuses BitCapital of Illegal Lending The National Bank of Ukraine (NBU) has accused the Ukrainian service BitCapital, which issues loans in USDT stablecoins, of providing illegal lending services. Over 700 complaints from citizens cite issues like high interest rates, wrongful charges, aggressive debt collection tactics, and lack of transparency. The service's operations in Ukraine are now banned. Read more here #Ukraine#BitCapital#USDT#Banking#Regulation#Lending#Finance#Crypto#NBU#Loans#ConsumerProtection#Debt#InterestRates#Bans#Complaints#Market#IllegalServices#Transparency#FinanceNews#VC#Crypto