Fix Python – Why use Python’s os module methods instead of executing shell commands directly?

I am trying to understand what is the motivation behind using Python’s library functions for executing OS-specific tasks such as creating files/directories, changing file attributes, etc. instead of just executing those commands via os.system() or
For example, why would I want to use os.chmod instead of doing os.system(“chmod…….

Fix Python – How to get the PATH environment-variable separator in Python?

When multiple directories need to be concatenated, as in an executable search path, there is an os-dependent separator character. For Windows it’s ‘;’, for Linux it’s ‘:’. Is there a way in Python to get which character to split on?
In the discussions to this question How do I find out my python path using python? , it is suggested that os.sep w….