Mega Code Archive

 
Categories / Python Tutorial / File
 

Read lines into a buffer

filePath = "input.txt" buffer = "Readline buffer:\n" inList = open(filePath, 'rU').readlines() print inList for line in inList:     buffer += line print buffer