Files
Reading one line at time
- Syntax: list_of_strings = file_object.readline()
Writing a string
- Syntax: file_object.write(string)
- output.write(“Price is %(total)d” % vars())
Writing a list of strings
- Syntax: file_object.writelines(list_of_string)
- output.writelines(price_list)