I've got this somewhat ugly code writing to a bunch of properties. It seems I should be able to loop through a list to do this. How would I loop through ['command','options','library'] and set the associated property?
<snip>
try:
self.command = data_dict['command']
except KeyError:
pass
try:
self.options = data_dict['options']
except KeyError:
pass
try:
self.library = data_dict['library']
except KeyError:
pass
<snip>
getattrfunction suffice?