.close() file method allows the user to close an open file within the IDE.
.close() to close the opened gullivers_travels.txt file:
f = open("gullivers_travels.txt", "r", encoding='utf8')f.close()
Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.
- Anonymous contributors
Learn Python on Codecademy
- Anonymous contributorsAnonymous contributors