‘tell’
method returns an integer giving the file object’s current position in the file
represented as number of bytes from the beginning of the file when in binary
mode and an opaque number when in text mode.
Previous
Next
Home$ cat /Users/harikrishna_gurram/data.txt first line Second line Third line Fouth line Fifth line Sixth line Seventh line Eighth line
>>> f=open("/Users/harikrishna_gurram/data.txt") >>> f.readline() 'first line\n' >>> f.tell() 11 >>> >>> f.readline() 'Second line\n' >>> f.tell() 23 >>> >>> f.readline() 'Third line\n' >>> f.tell() 34
No comments:
Post a Comment