Looping Over Characters with read Writing the Loop Differently : File Write « File « Python
- Python
- File
- File Write
Looping Over Characters with read Writing the Loop Differently
f = open("filename")
while 1:
char = f.read(1)
if not char: break
process(char)
f.close()
Related examples in the same category