Skip to main content

Shortcut functions for shell scripting on Python 3.7+

Project description

#!/usr/bin/env python3.7

from shell_scripting import run, shell, shell_list

run("date | sed s/2018/2019/ > test.out")

print(shell("env | grep USER").stdout.split("\n"))

print(shell("cat /root/file"))

r = shell("cat /root/file")
print(
    f"""\
    args: {r.args}
    returncode: {r.returncode}
    stdout: {r.stdout}
    stderr: {r.stderr}\
""",
    end="",
)

for x in shell_list("env"):
    print(x)

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

shell-scripting-0.0.1.tar.gz (1.4 kB view hashes)

Uploaded Source

Built Distribution

shell_scripting-0.0.1-py3-none-any.whl (1.8 kB view hashes)

Uploaded Python 3

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