I read this question in which the asker is having a specific problem with running bash in Python using code like this:
os.system(bashCommand)
The top two answers simply say: "use subprocess" (instead of os.system), and give a quick code example.
What is the proper way to run bash commands with Python and why? To me, it seems that os.system is a good option, being designed for this type of thing, and it is simply a fluke that the asker of the other question couldn't accomplish correct functionality with that package. But, is it "the true Pythonic way" to use subprocess? Or in other words, what is the difference between os.system and subprocess?
system()function in C -- whichos.system()wraps without changes -- is very, very old: It was designed back before security concerns were a thing, for example, so there wasn't any attention paid to keeping data out-of-band from code. It's not a good API in any language if one is concerned about handling hostile data safely.