Facebook Page Twitter Page LinkedIn Page
× Python Tutorial Python Advanced Python Resources Python Libraries


The Python file readable() method is used to check whether the specified file is readable or not. It returns true if the specified file is readable, else returns false.

Syntax

file.readable()

Parameters

No parameter is required.

Return Value

Returns True if the file is readable, else returns False.

Example: Check a file, readable or not

In the below example, Python file readable() method is used to check whether the file called MyFile is readable or not.

MyFile = open("python_test.txt")
print(MyFile.readable())

The output of the above code will be:

True

❮ Python File Handling Methods