title: Removing a temporary file in Python
body: <p>This is my existing code to zip a folder which I have put together mostly from help on here:</p>
  
  <pre><code>#!/usr/bin/env python
  
  import os
  import sys
  import datetime
  
  now = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M")
  target_dir = '/var/lib/data'
  temp_dir='/tmp'
  
  zip = zipfile.ZipFile(os.path.join(temp_dir, now+".zip"), 'w', zipfile.ZIP_DEFLATED)
  rootlen = len(target_dir) + 1
  for base, dirs, files in os.walk(target_dir):
     for file in files:
        fn = os.path.join(base, file)
        zip.write(fn, fn[rootlen:])
  </code></pre>
  
  <p>If I wanted to remove the zip file I just created at the end of the opperation, would the best command be this?</p>
  
  <pre><code>os.remove.join(temp_dir, now+".zip")
  </code></pre>