[Tutor] More Tkinter Help Please

Scot W. Stevenson scot@possum.in-berlin.de
Tue, 18 Jun 2002 01:07:21 +0200


Hello -=20

> However I seem to recall that Tk has a standard SaveAs type dialog
> already built that mimics the platform(Windows or Unix) SaveAs dialog
> so maybe you could use it.

It is called "asksaveasfilename" and lives in tkFileDialog. I used it in =
a=20
small program something like=20

    from tkFileDialog import *
    ...
    name =3D asksaveasfilename(initialfile=3Da_name)

where a_name is a suggestion that you give the user. Saves a lot of time,=
=20
it does.=20

Unfortunately, most of the beginner's Python books as well as "Python and=
=20
Tkinter Programming" don't give much documentation on these standard=20
dialogs; I ended up figuring out the parameters for asksaveasfilename by=20
giving fake versions (like "parrot=3Ddead") and reading the error message=
s.

Y, Scot

--=20
  Scot W. Stevenson -- scot@possum.in-berlin.de -- Zepernick, Germany