Python - How to convert a string from binary to integer list?
<p>I got a string like:</p>

<pre><code>s = "\0x01\0x02\0x01\0x11"
</code></pre>

<p>And I want to get the average number of that string. I tried this:</p>

<pre><code>sum = 0
for d in s:
    sum += int(d)
</code></pre>

<p>But it said "invalid literal for int() with base 10:'\x08'" :-(</p>
