(self, ms, func=None, *args)
Call function once after given time.

        MS specifies the time in milliseconds. FUNC gives the
        function which shall be called. Additional parameters
        are given as parameters to the function call.  Return
        identifier to cancel scheduling with after_cancel.
Call function once after given time.
Call function once after given time .
def after(self, ms, func=None, *args):
        """Call function once after given time.

        MS specifies the time in milliseconds. FUNC gives the
        function which shall be called. Additional parameters
        are given as parameters to the function call.  Return
        identifier to cancel scheduling with after_cancel."""
        if func is None:
            # I'd rather use time.sleep(ms*0.001)
            self.tk.call('after', ms)
            return None
        else:
            def callit():
                try:
                    func(*args)
                finally:
                    try:
                        self.deletecommand(name)
                    except TclError:
                        pass
            try:
                callit.__name__ = func.__name__
            except AttributeError:
                # Required for callable classes (bpo-44404)
                callit.__name__ = type(func).__name__
            name = self._register(callit)
            return self.tk.call('after', ms, name)
def after ( self , ms , func = None , * args ) : if func is None : # I'd rather use time.sleep(ms*0.001) self . tk . call ( 'after' , ms ) return None else : def callit ( ) : try : func ( * args ) finally : try : self . deletecommand ( name ) except TclError : pass try : callit . __name__ = func . __name__ except AttributeError : # Required for callable classes (bpo-44404) callit . __name__ = type ( func ) . __name__ name = self . _register ( callit ) return self . tk . call ( 'after' , ms , name )