Character reading from file in Python,f.close()