Programming with Python

⌘K
  1. Home
  2. Docs
  3. Programming with Python
  4. Files, Modules and Packag...
  5. Files
  6. File Operations
  7. Closing files

Closing files

Close File

  • close( ) function closes the file and frees the memory space acquired by the file
  • It is used at time when file is no longer needed or if the file is to be opened in a different mode

Syntax

fileobj.close( )

After closing a file, no operation can be performed on the file.

Views: 0

How can we help?

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments