Skip to main content

Run shell commands with python

Project description

pash

Run shell commands from pyhton

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.1.0.tar.gz (6.7 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.1.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file pash_py-0.1.0.tar.gz.

File metadata

  • Download URL: pash_py-0.1.0.tar.gz
  • Upload date:
  • Size: 6.7 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.1.0.tar.gz
Algorithm Hash digest
SHA256 23d6d1e056c844c700d86ff006e22d206c538f554ed632c21e50f973f6e01334
MD5 3643f949969a4f213ad9d7bdc3bb3d81
BLAKE2b-256 cbff2dc10024c7ff004c1ec5ecb88c37afa9bb84bc8fe6bb7bce64f9bb26e663

See more details on using hashes here.

File details

Details for the file pash_py-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pash_py-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae8980a0f7796baf38f571040492d5ca74316810b8ec41340ca60edb2e3b8f2e
MD5 8af72a97437363de436d1ff6f58d4685
BLAKE2b-256 726be67494c1b4a89992deb17756ff0233f0fdc104e4af29479a4e6c9a84bd64

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