Python file.seek() Method
The seek() method sets the current file stream position.
Syntax
file.seek(offset)
Parameters
| Parameter | Description |
|---|---|
offset |
Required. The index where the pointer should be placed. |
Return Value
The new file position.
Example
Using the seek() method:
Output
Click Run to execute your code
Enjoying these tutorials?