.close()
The .close()
file method allows the user to close an open file within the IDE.
Syntax
file.close()
Example
Use .close()
to close the opened gullivers_travels.txt file:
f = open("gullivers_travels.txt", "r", encoding='utf8')f.close()
Contributors
- Anonymous contributors