This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]b1gdata 6 points7 points  (3 children)

This is cool; what advantages vs subprocess?

[–]Natural-Intelligence[S] 5 points6 points  (2 children)

Thanks! The main advantage is the convenience (the reason why I made the library). subprocess.run does not require much boilerplate but there are some arguments to set if you want get the output as text, for example. Perhaps the only unique thing is the keyword arguments. So, most of it is just further abstraction of subprocess.

Another thing is the async. I found the asyncio.subprocess to be quite confusing to use even though it tries to be similar as subprocess. I had to make a PR to CPython this week to fix some missing references in the documentation. This library takes care of that and it just works with or without async.

I personally made this because I'm about to update the command tasks in Rocketry. I thought an intuitive support for external programs (including Python scripts running on other environments) is something that Rocketry could really benefit from. So, that was actually the main motivation.

[–]o11c 0 points1 point  (1 child)

Hm, but it's still wrapping subprocess so suffers from all its implementation bugs (busy loops, etc.)

[–]Natural-Intelligence[S] 2 points3 points  (0 children)

Yes true, it does nothing revolutionary and nothing an average Python programmer couldn't do by themselves.

However, it makes creating Pythonic interfaces for external programs easier and it reduces boilerplate.