ich erstelle gerade ein kleine Interface für meine Software. Die Interface soll ein "progress bar" haben, das löst aus, wenn die Software startet und gibt eine Nachricht 'finish', wenn das Programm zu Ende ist.
Hier ist meine code:
Code: Alles auswählen
# -*- coding: cp1252 -*-
from Tkinter import*
from PIL import Image, ImageTk
from DCM import*
import Tkinter, tkFileDialog
import os
#---------------------function's definition---------------------------------
def creeDialog1():
"""
create a dialog for the selection of the to be classified files....
"""
dirname1= tkFileDialog.askdirectory(parent=root,initialdir="/",title='Please select a directory')
dirInLab=Label(root,text='Infile:'+ dirname1)
dirInLab.pack()
return str(dirname1)
def creeDialog2():
"""
create a dialog for the selection of the classification's directory....
"""
dirname2= tkFileDialog.askdirectory(parent=root,initialdir="/",title='Please select a directory for the classification')
dirOutLab=Label(root,text='Outfile:'+ dirname2)
dirOutLab.pack()
return str(dirname2)
def creeWindow():
"""
create a window with a button'Close'that will be destroy after its release..
"""
fen=Tk()
fen.title('Welcome to v1.00')
tex=Label(fen,text='This the description of....',fg='red')
tex.pack()
bou=Button(fen,text='Close',command=fen.destroy)
bou.pack()
def dcm(dirs1,dirs2):
"""
callback the function Classification from DCM and execute
this one...
"""
os.chdir(dirs2)
Classification(dirs1)
def test():
"""
"""
call_Dialog1=creeDialog1()
call_Dialog2=creeDialog2()
dcm(call_Dialog1,call_Dialog2)
#---------------------main programm---------------------------------
if __name__ == '__main__':
root=Tkinter.Tk()
root.resizable(False,False)
root.title('Welcome to v1.00')
image=Image.open('log.png')
photo=ImageTk.PhotoImage(image)
Label_photo=Label(root,image=photo).pack(side=RIGHT)
tex1=Label(root,text='This programm....',fg='blue')
tex1.pack()
tex2=Label(root,text='(c)2009')
tex2.pack(side=LEFT)
bou1=Button(root,text='Start',command=test)
bou1.pack(side=LEFT)
bou2=Button(root,text='Help',command=creeWindow)
bou2.pack(side=RIGHT)
root.mainloop()
Danke im Voraus!
Bugsy!
Edit (Leonidas): Code in Python-Tags gesetzt.