Register the Python callable func as a Tcl command and return the name of the new command as a string. Whenever Tcl invokes that command, func is called; if subst is given, it is applied to the command’s arguments first. This is the mechanism used internally to turn Python callbacks into the command names passed to Tk options such as command. Unless needcleanup is false, the command is deleted automatically when the widget is destroyed.