27. How to run shell commands in modern Python

preview_player
Показать описание
Since Python3.7 there is a good enough syntax to run shell commands in a uniform way. I propose here to use two parameters to make the procedure equivalent to the well known back quote syntax available in other scripting languages. This procedure is extremely useful to know when programming for Linux and Unix based system.
Рекомендации по теме
Комментарии
Автор

Thank you, been hanging my head against my desk trying to do this with curl.

zerosum
Автор

Thank you Nicola so can I use pipeline as well, like tail -3 file | sed ‘s/pattern1/pattern2/g’

shelly
Автор

Do you know if I can apply this command to SSH into a raspberry?

dedmeme
Автор

Linked in twitter facebook deleted since 2015..u cant escape ..no whats app..

christinamariehicks