954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

File Dialog window, save dialog window

how to get the file dialog window and save dialog window in python. for example if select the File menu we can see Open menu option, when we click on that we get file open dialog window similarly when we click save as.... /save option we can see file save dialog. how to get in python?

katharnakh
Posting Whiz in Training
237 posts since Jan 2006
Reputation Points: 19
Solved Threads: 34
 

You mean something like that:

import tkFileDialog
# examples:
def open_it():
    filename = tkFileDialog.askopenfilename()
    print filename  # test
    
def save_it():
    filename = tkFileDialog.askopenfilename()
    print filename  # test
    
def save_as():
    filename = tkFileDialog.asksaveasfilename()
    print filename  # test
bumsfeld
Nearly a Posting Virtuoso
1,445 posts since Jul 2005
Reputation Points: 404
Solved Threads: 184
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You