title: Able to change a string in js and read it back but can't write back to the js file
body: <p>I tried to update the second line "app_version_1 = 'app.0111'; to "app_version_1 = 'app.0112';".  I open the file and file the specify line, modify the line and read it to make sure the 2nd line is change.  Then I tried to use write() to write is back to the text file but it didn't work.</p>
  
  <p><strong>Sample text file</strong>:</p>
  
  <pre><code>    app_version_0 = 'app.0111';
      app_version_1 = 'app.0111';
      app_version_2 = 'app.0113';
  </code></pre>
  
  <p><strong>Here is the code</strong>: </p>
  
  <pre><code>def edit_appversion():
      with open('test_file.js', 'r') as rf:
          with open('test_file.js', 'w') as wf:
              listme = rf.readlines()
              listme[1] = "app_version_1 = 'app.0112';"
              print(listme)
              wf = rf.writelines(listme)
              wf.close()
  
  def main()
      edit_appversion()
  </code></pre>