Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > tkFileDialog without a parent window

Reply
Thread Tools

tkFileDialog without a parent window

 
 
Stephen Boulet
Guest
Posts: n/a
 
      07-03-2003
I'm using the following code to get a file name:

import tkFileDialog
tkFileDialog.askopenfilename(filetypes=[("HDF Files", ".hdf")])

How can I do this without an empty tk window popping up and hanging around
after the dialog is closed? Thanks.

-- Stephen

 
Reply With Quote
 
 
 
 
Mike Abel
Guest
Posts: n/a
 
      07-05-2003
Stephen Boulet <(E-Mail Removed)> wrote:

> How can I do this without an empty tk window popping up and hanging around
> after the dialog is closed? Thanks.



Well i think this is probably a problem in your script not a
problem from tkFileDialog.

Mike
 
Reply With Quote
 
 
 
 
klappnase
Guest
Posts: n/a
 
      07-20-2003
Stephen Boulet <(E-Mail Removed)> wrote in message news:<be21e4$trp$(E-Mail Removed)>...
> I'm using the following code to get a file name:
>
> import tkFileDialog
> tkFileDialog.askopenfilename(filetypes=[("HDF Files", ".hdf")])
>
> How can I do this without an empty tk window popping up and hanging around
> after the dialog is closed? Thanks.
>
> -- Stephen


Hi,

you may use the withdraw() method on the root window:

root = Tk()
root.withdraw()
somefile = tkFileDialog.askopenfilename(filetypes=[("HDF Files", ".hdf")])
....

Cheers

michael
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If a class Child inherits from Parent, how to implementChild.some_method if Parent.some_method() returns Parent instance ? metal Python 8 10-30-2009 10:31 AM
Closing Parent window without prompt for Firefox 2 and IE 7 Tony Javascript 10 02-22-2007 01:16 PM
clicking on a thumbnail in a parent window causes parent to reload PWalker Javascript 1 02-24-2005 12:56 PM
How to auto close the parent / opener window without confirmation! PerryC Javascript 28 07-13-2004 03:24 PM
Closing child window WITHOUT closing parent thomas Javascript 0 10-23-2003 04:10 PM



Advertisments