seek operation in python

John Gordon gordon at
Wed Apr 29 20:53:21 CEST 2015

In <8b2bd328-08a6-4211-85c4-8d117d1aae1e at> siva sankari R <buddingrose11 at> writes:

> file=open("input","r")
> print line

> The above code is supposed to print a line but it prints "none".
> I don't know where the mistake is. Help.!

The seek() function doesn't return any data; it just relocates the file
pointer.  You still have to do a read operation to get data from the
new location.

John Gordon         Imagine what it must be like for a real medical doctor to
gordon at    watch 'House', or a real serial killer to watch 'Dexter'.

More information about the Python-list mailing list