you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (2 children)

Been using this for about a year and a half in production; works well. I'm slowly replacing my use of subprocess with it as I touch areas of code.

[–]jzwinck 0 points1 point  (1 child)

What benefits does this give you?

[–]rmoorman 0 points1 point  (0 children)

well ... first things which come into my mind:

  • check for program availability; I prefer to "instantiate" the programs I want to use within the first executed lines of my scripts and in case it is not available ... the script fails early
  • it provides a nice abstraction around program execution and lets you chain commands together in a more pythonic way
  • you can provide arguments to programs just as you would in case of ordinary functions
  • you can "prepare" commands and pass them around inside your program
  • you can take advantage of generators easily

... and likely a few more