I am having some problems working with the tell method when working with a file. Basically what I am trying to do is use the tell method to find where I currently am within a paragraph and to only display the characters up to a certain tell count. For example:
quote.txt="You will not apply my precept he said shaking his head How often have I said to you that when you have eliminated the impossible whatever remains however improbable must be the truth We know that he did not come through the door the window or the chimney We also know that he could not have been concealed in the room as there is no concealment possible When then did he come The Sign of the Four"
myfile=open("quote.txt","r") mylist1= myfile.tell() while myfile.tell() < 50: read=myfile.readline() print read print myfile.tell() mylist1.append(read)
I know I could simply put myfile.read(50) and it would display what I needed however I will be using an if statement later to specify and read sections based on the tell.
Any help would be greatly appreciated. I can also provide more information if needed. Thanks again!