Convert a string of bytes into a python string
<p>I made an array of bytes like so:</p>

<pre><code>import array
signal =  array.array('b', "bird")
print array
array('b', [98, 105, 114, 100])
</code></pre>

<p>I want to convert that back into <code>"bird"</code>.</p>

<p>How would I do that? </p>

<p>Join the ASCII-to-char array with <code>""</code> to create a string:</p>

<p>Python 2:</p>

<pre><code>import array

signal = array.array('b', "bird")
print("".join(chr(x) for x in signal))
</code></pre>

<p>Python 3 (<code>bytes</code> needs encoding because it's now REAL binary):</p>

<pre><code>import array

signal = array.array('b', bytes("bird","ascii"))
print("".join(chr(x) for x in signal)) # or print("".join(map(chr,signal)))
</code></pre>

python arrays byte ascii