Function Details: close

Description


Close the file. A closed file cannot be read or written any more.


Extended Description


The close() method closes the file and frees up any system resources taken up by the open file. After calling close(), attempts to read from or write to the file will raise a ValueError.


Function Signature



Module: io

Class: TextIOWrapper

Parameters



Return


This method doesn't return a value.


Return Type


None

Output

Explanation

This example demonstrates the basic usage of close(). The file is opened and then immediately closed.