Python binary to multi- hex
<p>I am trying to read a file in binary and return for example "ffffff" a series of 6 hex codes. does this make sense? The code I have (below) only returns a list of 2 so it looks like "ff"</p>

<pre><code>fp = open(f, 'rb')
hex_list = ("{:02x}".format(ord(c)) for c in fp.read())
</code></pre>

<p>i am specifically looking to make this return something like</p>

<pre><code>['ab0012', 'ffbaf0']
</code></pre>

<p>not like</p>

<pre><code>['ab', '00', '12', 'ff', 'ba', 'f0']
</code></pre>

<p>any help would be appreciated thanks. </p>

<p>How about this:</p>

<pre><code>fp = open(f, 'rb')
hex_list = ["{:02x}".format(ord(c)) for c in fp.read()]
return [''.join(hex_list[n:n+3]) for n in range(0, len(hex_list), 3)]
</code></pre>

python format hex bin ord