seek operation in python

MRAB python at mrabarnett.plus.com
Wed Apr 29 14:50:42 EDT 2015


On 2015-04-29 19:08, siva sankari R wrote:
> file=open("input","r")
> line=file.seek(7)
> print line
>
> The above code is supposed to print a line but it prints "none". I don't know where the mistake is. Help.!
>
'seek' will seek to position 7 in the file. It doesn't read. That's
what 'read' is for! :-)




More information about the Python-list mailing list