i was trying to loop on txt files which contain dictionary
my code is reading it as string also tried changing those txt file to json but as those words are in single quotes so it say:
Expecting property name enclosed in double quotes
code
for jfile in file_txt.glob('*.txt')
with jfile.open('r') as ifile:
lines_dict=ifile.read()
for page, word in lines_dict.items():
lines = convert_text_to_lines(word)
error
for page, word in lines_dict.items():
AttributeError: 'str' object has no attribute 'items'
example of my txt file
{1: [((86, 27, 168, 50), 'haha'), ((85, 53, 195, 63), ' work for you.'), ((323, 49, 408, 57), 'Total due'), ((534, 42, 590, 59), '4.10'), ((323, 66, 515, 77), ' do not need to make')}