title: Get Whole String From a Struct Pack in Python?
body: <p>What I am trying to do is to get a full length string from a Python struct.
  Here is my struct: <code>struct.pack('6s','Hello!')</code> Which is <code>'Hello!'</code>.
  But, when I am doing <code>struct.unpack('s','Hello!')</code> I get an error: <code>error: unpack requires a string argument of length 1</code>. One answer would be to get the length of the input and put that in front of the 's', however in more complicated situations where you get structs that contain more than just one string. So what I would like to know is how to get a string from a struct that has many parts to it. For example, a struct contains <code>int, string, unsigned short, string</code>.</p>
  
  <p>Tl;Dr: How would one get a full string out of a struct that has multiple integers and without knowledge of the length of the string?</p>
  
  <p>A little more knowledge of the true structure:</p>
  
  <p>Int, string (known size-is IP address of server (I am server)), Short, short, short, string (unknown size-is Username).</p>