def browseForFile(TkStringVar): TkStringVar.set(tkFileDialog.asksaveasfilename()) # Tkinter doesn't let you send arguments to functions, so we must make wrapper functions: