[Biopython-dev] subprocess and calling application wrappers

Brad Chapman chapmanb at 50mail.com
Tue Jun 1 13:23:55 UTC 2010


Peter;

> With the new command line wrappers and the tutorial pushing
> users towards using subprocess we've had more queries
> about how to use it. The subprocess module itself is rather
> scary I guess, and things could be made a lot easier.
[...]
> We could instead make the wrapper objects callable (define
> the magic method __call__) to offer this kind of functionality.
> This seems quite elegant to me. 

This is a good idea, although I'm 50/50 on the __call__ idea.
Having a run() command or something similar might be more intuitive
then the more magical call, if the idea is to appeal to users who
find subprocess too problematic.

I'd suggest having an option to not capture stdout and stderr, which
would help users avoid those cases where a program spews a lot to
stdout and it's unwieldy to capture and stick it into a string.

Brad



More information about the Biopython-dev mailing list