title: Python: Handle Missing Files from a Sequence
body: <p>I have a program that's basically as follows:</p>
  
  <pre><code>for l in range(0,100):  
   file = open("C:/Twitter/json/user_" + str(l) + ".json", "r")
   #do some stuff
   file.close()
  </code></pre>
  
  <p>I am trying to figure out a way to handle the exception that will be thrown if say file 20 is missing, and tell it to <code>continue</code>. I attempted to use the <code>continue</code> with a <code>try</code> statement however, it kept complaining that I wasn't putting it in the loop properly. Any advice would be appreciated.</p>
  
  <p>Basically I tried:</p>
  
  <pre><code>try:
   for:
  except:
   continue
  </code></pre>
  
  <p>Thanks,</p>