.close()
Anonymous contributors
Anonymous contributors
Anonymous contributors
Published May 10, 2021Updated Apr 12, 2022
Contribute to Docs
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()
All contributors
- Anonymous contributorsAnonymous contributors
- Anonymous contributors
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.