title: python slicing a string of numbers in to sections based on lengths within the string
body: <p>I have a string of numbers that I want to read from a file and parse into sub-sections, with lengths of the subsections based on numbers within the string. The first number in the string is the length of the first sub-section. So for example, if I have a string of data as follows:
  4, 11, 22, 33, 3, 44, 55, 5, 44, 55, 66, 77</p>
  
  <p>I want to divide up as follows:</p>
  
  <p>first subsection is length 4, so, 4, 11, 22, 33</p>
  
  <p>second subsection is length 3, so 3, 44, 55</p>
  
  <p>third subsection is length 5, so 5, 44, 55, 66, 77</p>
  
  <p>I tried using variables in slice, so that I could increment the start/stop values as I march through the data, but it doesn't take vars. I worked out a way to delete each subsection as I go so that the first value will always be the length of the next subsection, but it seems sort of clunky.</p>
  
  <p>I'd appreciate any suggestions - thx</p>