Python evaluating/compiling a string : <p>I want to evaluate a string to accomplish the following.  The string will be coming from an xml config file.  This is how I would configure a serial option without a config file:</p>

<pre><code>import serial
ser = serial.Serial(/dev/ttyUSB0)
ser.parity = serial.PARITY_MARK
...configure other options
</code></pre>

<p>Now this is the equivalent of what I want to do but...</p>

<pre><code>   str = "PARITY_MARK"
   ser.parity = some_wrapper("serial." + str)
</code></pre>
