Writing a dictionary to a text file?
First of all you are opening file in read mode and trying to write into it. Consult – IO modes python Secondly, you can only write a string or bytes to a file. If you want to write a dictionary object, you either need to convert it into string or serialize it. import json # … Read more