How to delete a dictionary or a key?

I have a large number of dictionaries that I regularly need to delete so this is how I do it:

KM 1 2020-11-10_18-19-04

In step 1 I loop through all the dictionaries whose name contains "DWM" and then...

In step 2 for each of those dictionaries I loop through each of their keys and set them to empty.

Your case may be different: the dictionaries you want to delete may not have something in common (like the "DWM" in mine) and you may not want to delete all the keys in them like I do.

So, in summary, to delete a dictionary you:

  1. set all its keys to the empty text.

When you've done that, the dictionary is no more! Hope that helps.

3 Likes