title: How to export a file into a different directory using Python?
body: <p>I'm trying to save myself from performing the old copy and past trick when saving files that Python generates.  The default is saving to the Python directory, however I would like it to be: C:\Program Files\Vixen\Vixen 2.1.1.0\Routines</p>
  
  <p>I have tried this:</p>
  
  <pre><code>import os
  filename = raw_input('What would you like to name the file? ')
  filepath = os.path.join("C:\Program Files\Vixen\Vixen 2.1.1.0\Routines",filename)
  with open(filename, 'wb') as out:
      for frame in frames:
          out.write(' '.join(str(num) for num in frame))
          out.write(' ')
          out.write('\n')
  </code></pre>
  
  <p>And the error I get is this:</p>
  
  <pre><code>Traceback (most recent call last):
    File "(stdin)", line 1 in (module)
    File "comet.py", line 169, in (module)
      filepath= os.path.join("C:\Program Files\Vixen\Vixen 2.1.1.0\Routines",filename)
  NameError: name 'os' is not defined  
  </code></pre>
  
  <p>How can I get Python to save the file directly into the desired path?</p>