Convert int to single byte in a string?
<p>I'm implementing PKCS#7 padding right now in Python and need to pad chunks of my file in order to amount to a number divisible by sixteen. I've been recommended to use the following method to append these bytes:</p>

<pre><code>input_chunk += '\x00'*(-len(input_chunk)%16)
</code></pre>

<p>What I need to do is the following:</p>

<pre><code>input_chunk_remainder = len(input_chunk) % 16
input_chunk += input_chunk_remainder * input_chunk_remainder
</code></pre>

<p>Obviously, the second line above is wrong; I need to convert the first <code>input_chunk_remainder</code> to a single byte string. How can I do this in Python?</p>
