Skip to main content

进一步封装了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.2.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

SWRunShell-1.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file SWRunShell-1.2.tar.gz.

File metadata

  • Download URL: SWRunShell-1.2.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/57.4.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.7

File hashes

Hashes for SWRunShell-1.2.tar.gz
Algorithm Hash digest
SHA256 d4e1584107df20688b790ba4c2f15cd39c894f657020593bad50906a00f99499
MD5 794c82a70ea3c674c2e6685d37ba7d34
BLAKE2b-256 b08a6ce7cd096a8fe9b2583e36888f02aa543ecf9408a2c2a059880fd232d43c

See more details on using hashes here.

File details

Details for the file SWRunShell-1.2-py3-none-any.whl.

File metadata

  • Download URL: SWRunShell-1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/57.4.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.7

File hashes

Hashes for SWRunShell-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d704817e0c3d318909b94af6481293e458ee4799cfca6bc3065b9c32053797dd
MD5 2f6684bd9c53280fee6fc929918046a3
BLAKE2b-256 75cf1660e7469b1590695c02d4a871d0b9f4e7a2f08a99db72a14d2012117306

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page