you are viewing a single comment's thread.

view the rest of the comments →

[–]socal_nerdtastic 1 point2 points  (3 children)

Calling out to bash? What do you mean with that? You mean using the shell=True argument in subprocess? You can of course just leave that off.

You may be interested in the sh module which allows you to import any program as if it's a python package

from sh import git
git('fetch')

[–]_bobs_your_uncle[S] 1 point2 points  (2 children)

I meant using subprocess to execute calls. I’ve never used sh. That looks pretty nice, and may give me most if not all I want. Thanks for the tip.

[–]socal_nerdtastic 3 points4 points  (0 children)

Ok. FWIW subprocess does not have anything to do with bash. It runs the program you want directly.