Definition Create the new object in parent widget. Syntax Button.pack() Options
Example Random color lines are created through the random.sample and random.randrange(a,b) methods through for loop.
The tkinter.Canvas create polygon method is used to create the random polygon point values and color is filled through random.sample method.
tkinter.button(command=print1) The button command executed the def print1.
The code create the text() through button and then destroy and created new buttom compose.
|