0
Run functions in different multi-time (python)
Suppose : we have three functions called A, B, and C. Function A prints time on the screen every second, and function B prints a message every 60 seconds that one minute has elapsed. Meanwhile, the C function is waiting to receive input, if the user enters the word Exit1, the A function will stop running, and if it enters Exit2, the B function will stop running. Finally, to exit the program, the user enters the word Exit. In C#, I can write code in 5 line. But i can't in python.
4 odpowiedzi
0
help yourself with schedule and time librairies
0
iTech
Thank you for your answer. But I do not think Schedule such a library. Have you ever written a code like my request?
0
First, those specs cd be done with 1 function only, unless it is an exam specs, you should then reproduce what you've been asked for.
Else, how do you plan to print time to the screen every second and a pop-up message every minute? the 3rd function is very easy to implement.
You will need time library.
https://stackoverflow.com/questions/53957142/JUMP_LINK__&&__python__&&__JUMP_LINK-how-to-print-datetime-datetime-now-every-second-in-file
for pop-up message, in windows you can use win10toast, for both Linux and windows you can use tkinter.
happy coding 😉
0
iTech
Thanks a bunch, very good😘👍🏻