Hi...This is my first post....I am a newbie to python programming and I have started a program that uses file handling....My problem is that despite the fact that other programming languages (pascal lets say) has an EOF command python doesnt...
My code is something like that:
[CODE=python]
for i in range (99): # this is just an example
fin.open("text" , "r+")
fin.seek(i)
text=fin.read(1 )
fin.close()
print fin
i=i+1[/CODE]
The problem is that the file is a document and I need to read every letter individually and stop reading at the end of the document.....An y ideas?
((Sry if this sound a little bit newbish but i am completely new to that stuff))
My code is something like that:
[CODE=python]
for i in range (99): # this is just an example
fin.open("text" , "r+")
fin.seek(i)
text=fin.read(1 )
fin.close()
print fin
i=i+1[/CODE]
The problem is that the file is a document and I need to read every letter individually and stop reading at the end of the document.....An y ideas?
((Sry if this sound a little bit newbish but i am completely new to that stuff))
Comment