Skip to main content

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pash_py-0.2.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

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

Hashes for pash_py-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5a0984e5a1bd7f10ac5938eed87eeba469ccacd90c7814c57667472fd82efe19
MD5 59f5f84096c95a184a6cf724d38729c3
BLAKE2b-256 65e5d9456df988887f0a1f14981faa8aed78dffdb26502af79f0a07b2a1cdc83

See more details on using hashes here.

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

Hashes for pash_py-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6f24c0ff185072007beced901885f87a5133919bd40f555251fa349a51128a5
MD5 8db09116053288a1c1fda04f3eeec479
BLAKE2b-256 48f39d15e7a5678ccf672ce116784262094e6e6ab458bcde70758b410efb88b4

See more details on using hashes here.

Supported by

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