Display waiting time in text box using WXPython
Question: 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


Answer: This is very simple to do with [Glade Interface
Designer](http://glade.gnome.org/). `import time` then, create a variable
`self.timer = None`.

Then when Click's `event` is raised simply state something like: `self.timer =
time.time()`.

When OK's `event` is raised, write to the `TextBox`:
`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?](http://stackoverflow.com/questions/85451/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](http://wiki.wxpython.org/Getting%20Started#A_First_Application%3a_.22Hello.2C_World.22)
first.

