tkinter file selector

Martin Franklin mfranklin1 at gatwick.westerngeco.slb.com
Mon Jan 13 15:52:18 CET 2003


On Mon, 2003-01-13 at 14:35, Natacha wrote:
> Hello,
> 
> We are using Python in environnement windows and we need help.
> 
> We want to use tkinter for an interface graphic so for this it s ok
> 
> The problem is in this programm :
> 
> you can execute it to see . When you click on 'Parcourir', i would
> like to have the functions who give the files in the harddisk and


<snip>

A simple example of the tkFileDialog :-

from Tkinter import *
import tkFileDialog

root = Tk()

def select_file():
    file = tkFileDialog.askopenfilename()
    print file

b=Button(root, text="Select", command = select_file)
b.pack()

root.mainloop()


HTH
Martin











More information about the Python-list mailing list