How can I check with plistlib to see if a key value is valid, or whether a key exists?
I tried:
if result['Tags'] != "":
dtags = result["Tags"]
dotags = '#' + ' #'.join(dtags)
else:
dotags = ""
and it simply returned the error:
KeyError: 'Tags'
Thank you
One way is to use the
get()method to check if the key exists: