子流程模块的python包装库。
subprocrunner的Python项目详细描述
subscrunner
Examples
Execute a command
Sample Code: | ^{pr 1}$ |
---|---|
Output: | ^{pr 2}$ |
dry run
Sample Code: | ^{pr 3}$ |
---|---|
Output: | ^{pr 4}$ |
Get execution command history
Sample Code: | ^{pr 5}$ |
---|---|
Output: | ^{pr 6}$ |
Get a command information
>>> fromsubprocrunnerimportWhich>>> which=Which("ls")>>> which.is_exist()True >>> which.abspath()'/usr/bin/ls' >>> whichcommand=ls, is_exist=True, abspath=/usr/bin/ls
Installation
Install from PyPI
pip install subprocrunner
Install from PPA (for Ubuntu)
sudo add-apt-repository ppa:thombashi/ppa sudo apt update sudo apt install python3-subprocrunner