A good practice when reading from a file in Python