opening 'file open' dialog from console 
Author Message
 opening 'file open' dialog from console

I would like to open a file open dialog from a console on windows (2000). I
do this now using the line

Quote:
>>> from tkFileDialog import *
>>> fileName = askopenfilename(filetypes=[(".txt", ".txt")], title="Select

the file")

but this opens a second window and leaves it there.  what is the best way
(tkinter or MFC) to do this w/o the second window?

thanks,

-doug



Sat, 19 Feb 2005 12:13:42 GMT  
 opening 'file open' dialog from console

Quote:

> I would like to open a file open dialog from a console on windows (2000).
> I do this now using the line

>>>> from tkFileDialog import *
>>>> fileName = askopenfilename(filetypes=[(".txt", ".txt")], title="Select
> the file")

> but this opens a second window and leaves it there.  what is the best way
> (tkinter or MFC) to do this w/o the second window?

Fetch the root singleton (or whatever it is) out of Tk land:

        root = Tk()

Withdraw it:

        root.withdraw()

Warning: Sometimes this withdraws the wrong thing. >sigh<

Alternately, pass it into 'askopenfilename', if possible.

--
  Phlip
          http://www.greencheese.org/ParodyMode
  --  Have a :-) day  --



Sat, 19 Feb 2005 12:38:24 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Intellimouse Returns 'File Not Open'

2. cannot open include file 'param.inc'

3. Opening a file with ACTION='READ'

4. file = open(path,'wb')?????

5. Input via OPEN(5,file='..')

6. Used to 'file = open(...)', now what?

7. Used to 'file = open(...)', now what?

8. File Dialog - Open button (Existing/new file)

9. File dialog for opening multiple files?

10. Selecting multiple files in the file open dialog

11. Open File Dialog boxes sort files backwards

12. Can't open RB file please help

 

 
Powered by phpBB® Forum Software