Python File seekable() Method

❮ File Methods


Example

Check if the file is seekable:

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

Definition and Usage

The seekable() method returns True if the file is seekable, False if not.

A file is seekable if it allows access to the file stream, like the seek() method.


Syntax

file.seekable()

Parameter Values

No parameters.


❮ File Methods

Copyright 1999-2023 by Refsnes Data. All Rights Reserved.