Function Details: tell

Description


Return the current stream position.


Extended Description


The tell() method returns the current position of the file read/write pointer within the file. This position represents the number of bytes from the beginning of the file. For text files, the returned value may not represent the exact byte offset due to character encoding.


Function Signature



Module: io

Class: TextIOWrapper

Parameters



Return


Returns an integer representing the current position of the file pointer.


Return Type


int

Output

Explanation

This example demonstrates the basic usage of tell(). It reads 5 characters and then prints the current position.