seek operation in python

Cecil Westerhof Cecil at decebal.nl
Thu Apr 30 14:31:20 CEST 2015


Op Wednesday 29 Apr 2015 20:08 CEST schreef siva sankari R.:

> 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.!

You could use my module:
    https://github.com/CecilWesterhof/PythonLibrary/blob/master/filebasedMessages.py

Then use:
    from filebasedMessages import get_indexed_message

    get_indexed_message('input.cpp', 7)

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof



More information about the Python-list mailing list