Is there a __start__ method?

Jeff Epler jepler at unpythonic.net
Thu Apr 25 17:50:56 EDT 2002


What good will it do you for your GUI to appear on the screen if it's
frozen anyway until this process of "accessing 3 separate URLs"
completes?

You can use the .after_idle() method in tk to schedule something to
happen when the gui becomes "idle".  From the tk documentation:
    after idle script ?script script ...?
	Concatenates the script arguments together with space separators
	(just as in the concat command), and arranges for the resulting
	script to be evaluated later as an idle callback. The script will
	be run exactly once, the next time the event loop is entered
	and there are no events to process.  The command returns an
	identifier that can be used to cancel the delayed command using
	after cancel. If an error occurs while executing the script then
	the bgerror mechanism is used to report the error.
however, while the "script" executes, the GUI will block.

You could arrange a system using Tcl file handlers, but last I knew
_tkinter.createfilehandler did not exist on Windows. (The underlying Tcl
API is marked "unix only" in the Tcl documentation)

Lastly, you could use a thread for this processing.  However, as another
thread recently said, only the main thread can access Tk stuff....

Jeff





More information about the Python-list mailing list