Published May 10, 2021Updated Apr 12, 2022
Contribute to Docs
.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()
- 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.
Learn Python on Codecademy
Computer ScienceLooking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
Includes 6 Courses
With Professional Certification