functions used to read files in python