tkFileDialog.askopenfilename

Russell E. Owen no at spam.invalid
Thu Mar 4 21:51:12 CET 2004


In article <8a5a6d82.0403041057.30d4c773 at posting.google.com>,
 srovner at us.ibm.com (Sonia Rovner) wrote:

>tkFileDialog.askopenfilename only allows you to open an existing file.
> I want to allow my users to enter a new filename in the dialog box. 
>Can anyone help?

Try:
tkFileDialog.asksaveasfilename

By the way, your installation probably has the source code; if so, this 
file is in <python root>/lib/lib-tk/ (if you don't have source it can be 
downloaded from python.org and individual files can be examined at 
sourceforge). I've found looking at the Tkinter-related files quite 
useful for figuring out stuff like this. In particular, I've found it 
helpful to look through tkFileDialog.py, tkFont.py and Tkinter.py.

-- Russell



More information about the Python-list mailing list