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

Пребарај: #crank

当前筛选 #crank清除筛选
Libreware

@libreware · Post #1007 · 05.11.2021 г., 00:54

We just pushed the V1.2 of the Beechat Crank to our GitHub @beechatnetwork2 Beechat Crank is a human-powered, open-hardware, fully-waterproof, electricity generator. The project was born out of the need to power electronics in all off-grid scenarios. We needed a way to power our devices in all weather conditions, and making a human-powered generator meant that problem could be solved. When we looked for a solution, we didn't find what we were looking for, so we decided to make it, and make it open source! https://github.com/BeechatNetworkSystemsLtd/BeechatCrank/ Features High power (3A) USB-C IPX8 output 18650 3600 mAh battery (LG M36) Charging time of 4 hrs 24 min. to full charge with 10% efficiency loss at 4.5 Watts. Overcharge protection Parts Beechat Crank is composed of the main device, which we call the Heart. It contains the battery, the generator and all the electronics (the handle is detachable) The Pedal Case is an assembly which the Heart can be attached in. which dramatically speeds up the charging from 2.5 hours to 25-30 minutes. This is achieved with reduction gears to, with the same revolutions per minute, generate more electricity. Generator part We have chosen the 35L048B1B motor with a mass of 88 grams, giving us us 450 mA for each phase of the coil and works at 5V. The wire leads are connected via female Molex connectors to the charging PCB board. New modifications: * Added a Molex type connector to the PCB to connect the motor. * The Zener diodes were changed, by means of a rectifier bridge. * A new and improved Texas Instruments brand battery management chip was selected. * Added a boost converter to allow different voltage batteries. * New Portescap brand two-phase generator with 90% efficiency and peak power of 4.5 Watts was selected. #crank#beechat

Видеотека 📼

@videotekashow · Post #14048 · 26.07.2025 г., 18:17

«Вообще, фильм «Карты, деньги, два ствола» был единственной причиной, по которой я поменял профессию». Джейсону Стэйтему сегодня исполнилось 58 лет. #ВИДЕОТЕКА #JasonStatham #LockStockAndTwoSmockingBarrels #Snatch #TheTransporter #Crank #TheExpendables #KillerElite #Safe #Parker #WrathOfMan #AWorkingMan