askopenfilename() as root window

Sean DiZazzo half.italian at gmail.com
Tue Dec 18 22:33:24 EST 2007


On Dec 18, 6:06 pm, Gabriel Genellina <gagsl-... at yahoo.com.ar> wrote:
> On 18 dic, 22:43, Sean DiZazzo <half.ital... at gmail.com> wrote:
>
> > Is there any way to open a Tkinter.askopenfilename() without opening a
> > root window alongside the file chooser?
>
> > I simply want a script to open a dialog and return the chosen file's
> > path to stdout.
>
> Yes, create the root yourself so you can call the withdraw() method:
>
> root = Tk()
> root.withdraw()
> print askopenfilename()
>
> --
> Gabriel Genellina

As usual... Thank you Gabriel.



More information about the Python-list mailing list