ใช้ tell() ดูตำแหน่งปัจจุบันของ file object
ตัวอย่าง
f = open('my_file.txt', 'r')
f.readline()
print(f.tell())
f.close()
ถ้าไฟล์มีข้อความ Hello\nworld หลัง readline() ตำแหน่งจะเป็น 6 (ชี้หน้า 'world')
ใช้ tell() ดูตำแหน่งปัจจุบันของ file object
f = open('my_file.txt', 'r')
f.readline()
print(f.tell())
f.close()
ถ้าไฟล์มีข้อความ Hello\nworld หลัง readline() ตำแหน่งจะเป็น 6 (ชี้หน้า 'world')