Hacker News new | ask | show | jobs
by nknight 5302 days ago
One loads the subprocess documentation and is confronted by a (on my monitor/fonts) ~11 page morass.

The little part you link to starts off simple, sure, but then says "Calling the program through the shell is usually not required.", and proceeds to present a "more realistic example", leading to an immediate "WTF?" for anyone just learning of subprocess.

People who have been doing things the obvious way for years will not take well to a new mechanism that they don't understand the function nor implications of, and whose use is immediately discouraged by its own documentation.

1 comments

How is that a WTF? It's exactly the same code you could/should use with os.system()! And besides, it's completely straightforward Python.
You're talking about what you think programmers should do. I'm talking about what they actually do.

99% of system() calls (regardless of language) will never be so adorned. It's used for quick hacks, rarely anything more. If the return code is checked at all, people only pay attention to whether it's something other than 0.