title: Python get sublists
body: <p>I've a very simple question about python and lists.</p>
  
  <p>I need to cycle trough a list and get sublists of a fixed lenght, spanning from the beginning to the end. To be more clear:</p>
  
  <pre><code>    def get_sublists( length ):
              # sublist routine
  
      list = [ 1, 2, 3, 4, 5, 6, 7 ]
  
      sublist_len = 3
  
      print get_sublists( sublist_len )
  </code></pre>
  
  <p>this should return something like this:</p>
  
  <pre><code>    [ 1, 2, 3 ]
      [ 2, 3, 4 ]
      [ 3, 4, 5 ]
      [ 4, 5, 6 ]
      [ 5, 6, 7 ]
  </code></pre>
  
  <p>Is there any simple and elegant approach to do this in python?</p>