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

Резултати

Пронајдени 5 слични објави

Пребарај: #whiteboard

当前筛选 #whiteboard清除筛选
𝐋abyrinth

@labyrinthclassh · Post #9336 · 11.12.2021 г., 12:36

˖ ࣪⭑ Dingg.. Dongg.. 🛎 Check it out students, the bell has rung. It’s such an honour to present our new #Whiteboard. Dont forget to read our school rules before using it hoho. Have a wondrous day ahead! ♡⸝⸝

Hashtags

𝐋abyrinth

@labyrinthclassh · Post #8837 · 07.11.2021 г., 01:17

˖ ࣪⭑ Dingg.. Dongg.. 🛎 Check it out students, the bell has rung. It’s such an honour to present our new #Whiteboard. Dont forget to read our school rules before using it hoho. Have a wondrous day ahead! ♡⸝⸝

Hashtags

𝐋abyrinth

@labyrinthclassh · Post #8193 · 14.10.2021 г., 07:33

˖ ࣪⭑ Dingg.. Dongg.. 🛎 Check it out students, the bell has rung. It’s such an honour to present our new #Whiteboard. Dont forget to read our school rules before using it hoho. Have a wondrous day ahead! ♡⸝⸝

Hashtags

𝐋abyrinth

@labyrinthclassh · Post #8012 · 07.10.2021 г., 10:23

˖ ࣪⭑ Dingg.. Dongg.. 🛎 Check it out students, the bell has rung. It’s such an honour to present our new #Whiteboard. Dont forget to read our school rules before using it hoho. Have a wondrous day ahead! ♡⸝⸝

Hashtags

GitHub Trends

@githubtrending · Post #15082 · 21.08.2025 г., 11:30

#typescript#collaboration#drawing#flowchart#localfirst#mindmap#productivity#whiteboard Drawnix is a free, open-source online whiteboard tool that combines mind maps, flowcharts, and free drawing in one platform. It supports features like image insertion, undo/redo, infinite canvas zooming, and exporting to PNG or JSON. It works on mobile devices and supports markdown and mermaid syntax for easy diagram creation. Built on a plugin architecture, it allows flexible development and integration with different UI frameworks. Using Drawnix helps you organize ideas visually, collaborate smoothly, and save your work automatically, making creative work and teamwork easier and more efficient. https://github.com/plait-board/drawnix