Converted to mixed os and python file ops