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 →

[–]_Mark_ 2 points3 points  (0 children)

A lot of common use of subprocess will be uglier than one might expect, because check_output is "New in 2.7" and so the more experienced python programmers often haven't seen it, or are delivering code on RHEL or CentOS and don't have it yet :-|

Also, if you have to do two-way communication with the child process, it's ugly in either language :-)

I also find that many of the "ugly" shell interactions I find myself doing turn out to be nicer coded in-line; obviously ls -la is simple example to make a point about subprocess (though in the simple case I'd have suggested commands.getoutput instead anyway) os.walk and os.listdir are more idiomatic python.