Read bytes into a buffer : Read : File PYTHON TUTORIALS


PYTHON TUTORIALS » File » Read »

 

Read bytes into a buffer


filePath = "input.txt"

buffer = "Read buffer:n"
file = open(filePath, 'rU')
while(1):
    bytes = file.read(5)
    if bytes:
        buffer += bytes
    else:
        break

print buffer



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo File
» Read