title: peek syntax and usage
body: <p>I am writing my own program using <code>peek</code> and this is what I have:  </p>
  
  <pre><code>with open('temp.txt', 'r') as inpf2:
      while True:
              c = [inpf2.read(1)]
              if not c:
                  break
              k = c.peek(2)
              for d in k:
                  if(d == ""):
                      break
                  else:
                      c = c.append(d)
              print c  
  </code></pre>
  
  <p>In this program, i am using <code>peek</code> to see ahead 2 characters in a text file which has text like <code>abcdefg</code> and trying to print out strings of 3 characters like <code>abc</code>, <code>bcd</code>, <code>cde</code>, <code>def</code>, <code>efg</code>.  </p>
  
  <p>But when I execute this program, i am getting the error,   </p>
  
  <pre><code>k = c.peek(2)  
  AttributeError: 'list' object has no attribute 'peek'.  
  </code></pre>
  
  <p>Where am I doing a mistake?</p>