title: Python: Opening multiple files using 'with open'
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4617034/python-open-multiple-files-using-with-open">Python: open multiple files using “with open”?</a><br>
    <a href="https://stackoverflow.com/questions/12138298/does-with-open-not-works-with-python-2-6">Does, With open() not works with python 2.6</a>  </p>
  </blockquote>
  
  
  
  <p>I have seen other answers to help me with this.
  But I can't  seem to get any of the solutions provided to work at all!
  Here is part of my code for it:</p>
  
  <pre><code>with open('Levels.dat', 'w') as l, open('Names.dat', 'w') as n:
  </code></pre>
  
  <p>I got this error:</p>
  
  <pre><code>    with open('Levels.dat', 'w') as l, open('Names.dat', 'w') as n:  
                                       ^
  SyntaxError: invalid syntax 
  </code></pre>
  
  <p>How do I fix this?</p>