Run shell commands with python
Project description
pash
Run shell commands from pyhton
Available on pypi pash-py
from shell 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.2.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.2.0.tar.gz.
File metadata
- Download URL: pash_py-0.2.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 |
5a0984e5a1bd7f10ac5938eed87eeba469ccacd90c7814c57667472fd82efe19
|
|
| MD5 |
59f5f84096c95a184a6cf724d38729c3
|
|
| BLAKE2b-256 |
65e5d9456df988887f0a1f14981faa8aed78dffdb26502af79f0a07b2a1cdc83
|
File details
Details for the file pash_py-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pash_py-0.2.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 |
e6f24c0ff185072007beced901885f87a5133919bd40f555251fa349a51128a5
|
|
| MD5 |
8db09116053288a1c1fda04f3eeec479
|
|
| BLAKE2b-256 |
48f39d15e7a5678ccf672ce116784262094e6e6ab458bcde70758b410efb88b4
|