This is what I have so far:
for key,value in spee_dict:
with open(key, 'w+') as f:
f.write(value)
I get the following: ValueError: too many values to unpack
Probably this is because I have tens of thousands of words stored as values for each key. There are 893 keys. How can I get around this error?
Edit:
Key
and value
are all string.
Here are a few example of keys and values for spee_dict
:
key value
speech1 we should have gone to the other country a few years ago
speech2 our tax situation is completely fine and revenues are increasing
speech3 ladies and gentlemen, thank you for your attention
...
Basically, I want in a folder on my U:/ drive files like speech1.txt
, speech2.txt
, and speech3.txt