tkFileDialog.askopenfilename

Peter Otten __peter__ at web.de
Thu Mar 4 14:45:41 EST 2004


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?

Seems you are out of luck:

"The procedures tk_getOpenFile and tk_getSaveFile pop up a dialog box for
the user to select a file to open or save. The tk_getOpenFile command is
usually associated with the Open command in the File menu. Its purpose is
for the user to select an existing file only. If the user enters an
non-existent file, the dialog box gives the user an error prompt and
requires the user to give an alternative selection. If an application
allows the user to create new files, it should do so by providing a
separate New menu command. "

Quoted from http://www.tcl.tk/man/tcl8.5/TkCmd/getOpenFile.htm

Peter




More information about the Python-list mailing list