title: SyntaxError: invalid syntax using path to file in 'with open'
body: <p>I'd like to write something to 'impf_rel.txt' which is located at 'C:\Abaqus_JOBS\Reliability\Job'. I wrote:</p>
  
  <pre><code>with open('C:\\Abaqus_JOBS\\Reliability\\Job\\impf_rel.txt', 'w')
      text_file.write("%s" % '#imp_local\n')
      text_file.write("%s" % '#imp_global')
  </code></pre>
  
  <p>And I get:</p>
  
  <pre><code>with open('C:\\Abaqus_JOBS\\Reliability\\Job\\impf_rel.txt', 'w')
                                              ^
                                              SyntaxError: invalid syntax
  </code></pre>
  
  <p>Both the directory and the file name are correct and they exist. Can you help me with this error? Thanks</p>
  
  <p>EDIT:
  If I ask alternatively:</p>
  
  <pre><code>with open('C:\\Abaqus_JOBS\\Reliability\\impfrel.txt', 'w')
      text_file.write("%s" % '#imp_local\n')
      text_file.write("%s" % '#imp_global')
  </code></pre>
  
  <p>I still get an error:</p>
  
  <pre><code>with open('C:\\Abaqus_JOBS\\Reliability\\impfrel.txt', 'w')
                                              ^
                                              SyntaxError: invalid syntax
  </code></pre>