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.2.tar.gz
(1.4 kB
view hashes)
Built Distribution
Close
Hashes for shell_scripting-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16320c414b3cd34ae3bc4ef8b5aee8b9626a70e14c706acb87ec9045d088b168 |
|
MD5 | 607a1f362730ab6538889f97ba786f49 |
|
BLAKE2b-256 | 0c5d7dd4bbb7426da31addeda8124238602937536559854e7d16aba2ab6ad56f |