while closing the file I get this OSError. Can anyone explains what's going wrong?
>>> f=open('fr.txt','w')
>>> print('hey',file=f)
>>> f.close()
OSError: [Errno 9] Bad file descriptor
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 9] Bad file descriptor