Откройте Python с закрытым файлом
open(f.name).read()
# prints the content of closed and reopened file
Bad Buffalo
open(f.name).read()
# prints the content of closed and reopened file