News for hackers. Stuff that matters.
Re:I got tired of PHP and Perl, so I tried bash by amelius on Saturday April 13, 2019 @06:13AM (#19652074)
Isn't this what os.system(...) does?

By the way, why not put the raise inside sh?

EDIT: Ok, the difference is that os.system does not return stdout. But you can use the subprocess package to capture stdout (and stderr as well). If you want pipe syntax, you can invoke e.g. bash -c "...", where the dots are your command. But the problem with this is that it's prone to injection attacks, unless you are very careful. I guess the same warning applies in your original "sh" example.

There are no comments on this comment yet.