Settings

Theme

Show HN: Pysh – run shell commands in Python

github.com

4 points by antiatheist 3 years ago · 2 comments · 1 min read

Reader

I was bored and tired of creating subprocess wrappers for lots of projects, so I made this.

The implementation is fairly naive and a bit slow, but it works well in my testing.

Might be a bit useless, but it was a fun and somewhat interesting project.

billconan 3 years ago

if in the main python file, I include another python file that also contains shell commands, can Pysh parse the includes too?

  • antiatheistOP 3 years ago

    It's possible but I haven't tested it enough to iron out any kinks.

    And right now the main routines are return-blocked by an environment variable (PYSH_ROOT) thats set when the first pysh wrapper is started.

    Feel free to remove these and test how well it works for you.

    EDIT: I might have misunderstood, if they're in an import they wont be parsed right now, you would need to run pysh() in there too. I haven't tested so I'm not sure how this will work.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection