How do I set a property in python using its string name
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/285061/how-do-you-programmatically-set-an-attribute-in-python">How do you programmatically set an attribute in Python?</a>  </p>
</blockquote>



<p>Hey, here's a dumb question: how can I set an object property given its name in a string. I have a dictionary being passed to me and I wish to transfer its values into namesake properties using code like this:</p>

<pre><code>    for entry in src_dict:
          if entry.startswith('can_'):
              tgt_obj[entry] = src_dict_profile[entry]
</code></pre>

<p>I'm still a bit of a noob with Python so would appreciate some help.
- dave.</p>
