title: Python Struct Unpack
body: <p>I have this little problem that has been bugging me for the past hour or so.</p>
  
  <pre><code>string = b'-'
  t = struct.pack("&gt;h%ds" % len(string), len(string), string)
  print(t)
  </code></pre>
  
  <p>the result of this pack is b'\x00\x01-'</p>
  
  <p>The problem I'm having is that I can't figure out how to unpack the result b'\x00\x01-' so that it's just '-', Yes. I know I can just remove the crap in the front but it gets a little bit more complicated. I tried to simplify it here. Hopefully someone can assist me. :)</p>