> would it be advisable to guard against this with something like this? > > def perform_longrunning_calculation(): > if not app.busy: > app.busy = 1 [...] By using that kind of construct, instead of using update_idletasks(), you force all code to be aware of and manage the app.busy flag.
Another difference is that with the original code changed to use update_idletasks(), perform_longrunning_calculation *will* be called twice, the second time after the first one completes. With your code, it will be called once if the second keypress comes within one second, and twice if called after one second is up. (though a second update before setting busy back to false will make it be called only once) So in also depends on what you want your application to do in these cases. Jeff
pgpZrbYdr8Uyk.pgp
Description: PGP signature
-- http://mail.python.org/mailman/listinfo/python-list