TGViewer
Python Learning Python Learning @python_bds Β· 5.74K subscribers
Post #1297 319
The tell() function in Python 🐍

The tell() function returns the current position of the file pointer within the data stream. It is most often used when working with files. πŸ“‚

The function does not accept any arguments and returns an integer - the position in bytes from the beginning of the stream. πŸ”’

with open("file.txt", "rb") as f:
print(f.tell())
  • ❀ 5
More from @python_bds
  1. Oct 6, 2026🐍 Python Performance Optimization Python Performance Optimization: Make Your Code Faster…
  2. Oct 4, 2026Python Set Methods ✍️
  3. Oct 3, 2026Post #1310
  4. Oct 1, 2026🐍 Python Beginner Notes
  5. Sep 30, 2026🧠 return vs print() in Python These are not interchangeable. def add(a, b): print(a + b)…
  6. Sep 28, 2026PYTHON SKILL ROADMAP β”‚ β”œβ”€β”€ πŸ“ Python Basics β”‚ β”œβ”€β”€ πŸ“ Variables & Data Types β”‚ β”œβ”€β”€ πŸ“ Input…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook β†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 β†’