title: I am trying to parse a fixed width mainframe screenshot file with python using struct and string module. I am getting below error
body: <p>In [1]: import string</p>
  
  <p>In [2]: import struct</p>
  
  <p>In [3]: baseformat = '10s 1x 25s 10s 1x 20s'</p>
  
  <p>In [4]: theline = "DD        :   3KZ                   BD NAME   : PETERA QDVISORS LLC"</p>
  
  <h2>In [5]: mytup = struct.unpack_from(baseformat,theline,offset=0)</h2>
  
  <p>TypeError                                 Traceback (most recent call last)
   in ()
  ----> 1 mytup = struct.unpack_from(baseformat,theline,offset=0)</p>
  
  <p>TypeError: a bytes-like object is required, not 'str'</p>