Python - substitute inplace - removing .bak backup files with close()?
<p>When I run the following script, a .bak backup file is left in the filesystem.
How do I close() the files(s) properly so the backups are deleted?</p>

<pre><code>#!C:\Python27\python.exe
import os
myRelease = os.environ.get("BUILD_STRING")
myVersion = os.environ.get("VERSION_STRING")
import fileinput
import re
files = ["C:\Projects\FileToSub.sbs"]
for line in fileinput.FileInput(files,inplace=1):
   line = re.sub('whatever, thing', line)
   print line,
</code></pre>
