Run shell commands with python
Project description
pash
Run shell commands from pyhton
Available on pypi pash-py
from pash import Shell
# Create a shell instance
sh = Shell(suppress_printing=True)
# create a command
cmd = sh.ls("-la") | sh.grep("-ie", "main") > "test.txt"
cmd2 = sh.cat() << "this is a line obviously\n"
# you could use sh.command(command, *args) if the function you want not present in the module
# or submit a pull request if you want it incorporated
# run the command
cmd()
cmd2()
# print the command output
print(cmd.stdout()) # print(cmd.stderr())
print(cmd2.stdout()) # print(cmd.stderr())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pash_py-0.3.0.tar.gz
(6.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pash_py-0.3.0.tar.gz.
File metadata
- Download URL: pash_py-0.3.0.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdccc3cb566e34143bb7ac868c9d20acf30a9b6508c872c4a5fbf816e486d370
|
|
| MD5 |
fcb3193382dc4063c29cfcb7a7dbdd58
|
|
| BLAKE2b-256 |
4fdf6dd0127e54497c5949dd4ce8e0ace35de74123b9933824bcd7b1b1864fb2
|
File details
Details for the file pash_py-0.3.0-py3-none-any.whl.
File metadata
- Download URL: pash_py-0.3.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdd10e6755fb78441940e973c267c3c88e2df0a2cc8173ad5266f9829d54abeb
|
|
| MD5 |
b1f177088b1e1d6521103ea5cf8394da
|
|
| BLAKE2b-256 |
b65fc8cf6f1166f5d36fb86d456b66bcba4fed70b32d4736dd5451aa8fc2aae7
|