Python File seekable() Method

Example

Check if the file is searchable:

f = open("demofile.txt", "r")
print(f.seekable())

Running an Example

Definition and Usage

If the file is searchable, the seekable() method returns True, otherwise it returns False.

If the file allows access to the file stream (such as the seek() method), then the file is searchable.

Syntax

file.seekable()

Parameter Value

No Parameters.