How to get bit value of hex number based on position in python
<p>Hi Friends I'm new person to Python language. I'm trying to write some small code which I want to integrate later in my python module. Here is my question</p>

<ol>
<li><p>I have a number like <code>a[31:0]= 0X00010001</code> in a file and I want to get bit value based on position and do the operation based on its bit value. 
I want to use something like common class across and I'm looking for solution if a number is more than 32 bits as well.
<code>0x00010001.getbit(0) == 0</code> do some operation. Expecting if bit0 is 0 do operation.</p></li>
<li><p>One more I'm looking if I have corresponding mask bit how do I get value based on mask bit
<code>0x00010001</code> in this case <code>bit[15]</code> is mask and <code>bit[0]</code> is value. </p></li>
</ol>

<p>Appreciate help.</p>

<p>I have tried doing via bitstream module but was not successful </p>