8000 GitHub - MKamelll/pash: Run shell commands from pyhton
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

MKamelll/pash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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())

About

Run shell commands from pyhton

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0