title: Writing to a file from a python module
body: <p>I am currently trying to debug an app that I have not written myself. I have narrowed the problem down to a particular method that is imported from a module outside of the current script. I would like to step through this module by writing to a file at each step, however it doesn't seem to work.</p>
  
  <p>I have a version of the app that is running correctly and when I write to a file from within the module, the script runs fine but no file is created. Am I missing something here?</p>
  
  <p>Example</p>
  
  <p>Script that I am debugging</p>
  
  <pre><code>from module import method
  
  example code ...
  method(data)   ---  where error occurs
  more code ...
  </code></pre>
  
  <p>module.py</p>
  
  <pre><code>def method(data):
      file = open('filetowrite.txt','w')
      file.write('something ....')
      file.close()
  </code></pre>