Dec-24-2021, 11:40 AM
hi, sorry for my bad english,
i have this case:
as you can see the program is very simple,
and my question is, how make the "AddOne()" function or "Add 1" is called every 1 second?
I ask this because (as far I know) the python is procedural programming, and this task require Object Oriented one
thank you for reading, and have a nice day
i have this case:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import tkinter TheWindow = tkinter.Tk() def AddOne(): value = int ( int (TextBox.get()) + 1 ) TextBox.delete( 0 , tkinter.END) TextBox.insert( 0 , str (value)) def RemOne(): value = int ( int (TextBox.get()) - 10 ) TextBox.delete( 0 , tkinter.END) TextBox.insert( 0 , str (value)) PlusButton = tkinter.Button(TheWindow, text = "Add 1" , command = AddOne) MinusButton = tkinter.Button(TheWindow, text = "Remove 10" , command = RemOne) TextBox.insert( 0 , 0 ) TextBox.pack() PlusButton.pack() MinusButton.pack() TheWindow.mainloop() |
and my question is, how make the "AddOne()" function or "Add 1" is called every 1 second?
I ask this because (as far I know) the python is procedural programming, and this task require Object Oriented one
thank you for reading, and have a nice day