fixed the os calls in python scripts