Unify the usage of os in python script