I think we can use the timer function of threading. I think the following schematic will be possible simply. When calling another function as a callback in the threading.timer, it would be good to note that the function input value should be included as follows.
import threading
def b_function():
print("This is B")
def a_function(time):
print("This is A")
threading.Timer(time, b_function).start()
def genesis_function(time):
threading.Timer(time, a_function, [time]).start()
genesis_function(10)
#10 seconds later
This is A.
#10 seconds later
This is B.
© 2024 OneMinuteCode. All rights reserved.