I want to make a application in which there are two buttons(say click & ok) and a text box.I want to generate waiting time between clicking on two buttons and display in text box.
For Example:-
If I first click on CLICK Button and wait for few seconds/minutes then click on OK Button. Then this waiting time should be displayed on text box.
Please help me.
Thanks in advance
This is very simple to do with Glade Interface Designer.
import timethen, create a variableself.timer = None.Then when Click’s
eventis raised simply state something like:self.timer = time.time().When OK’s
eventis raised, write to theTextBox:str((time.time()-self.timer)).This worked for me. If you aren’t using glade, you can still use the same concept after you create your GUI.
See Also – Python – time.clock() vs. time.time() – accuracy?
If you are asking how to code everything (including the GUI) in wxPython, I would suggest looking at some tutorials first.