Mega Code Archive

 
Categories / Python Tutorial / File
 

Read entire file into a buffer

filePath = "input.txt" buffer = "Read buffer:\n" buffer += open(filePath, 'rU').read() print buffer