self.file_opt = options = {}
options['filetypes'] = [('all files', '.*'), ('text files', '.txt')]
options['initialfile'] = 'myfile.txt'
options['parent'] = root

def asksaveasfilename(self):
    filename = tkFileDialog.asksaveasfilename(**self.file_opt)
if filename:
    return open(filename, 'w')
if __name__ == '__main__':
    root = Tkinter.Tk()
TkFileDialogExample(root).pack()
root.mainloop()
how to use Python SaveAs dialog