title: Closing file after using to_csv()
body: <p>I am new to python and so far I am loving the ipython notebook for learning.  Am I using the to_csv() function to write out a pandas dataframe out to a file.   I wanted to open the csv to see how it would look in excel and it would only open in read only mode because it was still in use by another How do I close the file?</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  import statsmodels.api as sm
  import csv
  
  df = pd.DataFrame(file)
  path = "File_location"
  
  df.to_csv(path+'filename.csv', mode='wb')
  </code></pre>
  
  <p>This will write out the file no problem but when I "check" it in excel I get the read only warning.  This also brought up a larger question for me.  Is there a way to see what files python is currently using/touching? </p>