进一步封装了subprocess,Python调用shell命令
Project description
SWRunShell
进一步封装了subprocess,Python调用shell命令;
支持 Python2, Python3;
安装 Install
pip3 install SWRunShell
使用
from swrunshell import shell_command
command = 'echo "hello, world!"'
# 参数说明:
# print_command: 是否将command 打印到终端,默认False
# print_log: 是否打印shell命令执行结果,默认False
# error_to_output: 是否把错误信息stderr重定向到标准输出stdout,默认True
# print_error: 异常时,是否打印错误信息,默认True
shell_command.call(command, print_command=False)
shell_command.check_call(command)
shell_command.check_output(command)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
SWRunShell-1.0.2.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for SWRunShell-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07fa7700efc0d0c8e7df91b6f8866076c1ad1aca997829b50ca8703e6ee78102 |
|
MD5 | 097de76992e3ef85b4e7668742894da2 |
|
BLAKE2b-256 | 1a334dafcdde6addcf9b8bf41b869f7ef2345b9b197f5d24121095d8d8658f8f |