title: How to save text from a Text-widget Tkinter to a .doc using asksaveasfile?
body: <p>I want to save some stuff I entered in a Text widget to a <code>.txt</code> or <code>.doc</code> format, using an asksaveasfilename dialog box. After this I want it to open in resp. Notepad or MS Word.</p>
  
  <pre><code>from tkFileDialog import asksaveasfilename
  import os.path
  
  name = asksaveasfilename(
             initialdir="dir",
             title="Save as",
             filetypes=[("Text files",".txt"),("Word files",".doc")])
  
  data = open(name,"w")
  data.write("text from text widget")
  
  os.startfile(name)
  </code></pre>
  
  <p>It creates the file but it won't open it in MS Word or Notepad. Instead it asks how I want to open this file. If I choose the programm it will open correctly, but I want it to open directly. (without choosing a program to open the file with). When I give the extension directly in the "File name:" box it works the way I want though.</p>
  
  <p>This works:
   File name:    something.doc
   Save as type: Word file (*.doc)
  ---> creates something.doc and opens it in MS Word.</p>
  
  <p>But this doesn't
   File name:    something
   Save as type: Word file (*.doc)
  ---> creates something (no extension) and ask in what program I want it to open.</p>
  
  <p>I use Python 2.7.8, Windows 8, Office 2010.</p>