1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
# -*- coding:Latin-1 -*-
import Tkinter
import tkFileDialog
def choixrep(rep):
rep = tkFileDialog.askdirectory(initialdir="/",title='Choisissez un repertoire')
if len(rep) > 0:
print "vous avez choisi le repertoire %s" % rep
fen1 = Tkinter.Tk()
tex1 = Tkinter.Label(fen1, text='Répertoire des sources')
tex1.pack()
rep =''
btnchoixrep = Tkinter.Button(fen1, text='Votre choix', command = choixrep(rep))
btnchoixrep.pack()
btnquitter = Tkinter.Button(fen1, text='Quitter', command = fen1.destroy)
btnquitter.pack()
fen1.mainloop() |
Partager