I've been trying for around half an hour now and just cant seem to wrap my head around what im doing wrong here. Working Code:
import threading
from time import sleep
def printX():
threading.Timer(5.0, printX).start()
print("five")
printX()
while True:
print("1")
sleep(1)
This works, however I need to be able to dynamically assign what the print statement will be along with the delay. Desired Code:
import threading
from time import sleep
def printX(time, message):
threading.Timer(int(time), printX).start()
print(str(message)
printX(time, message)
while True:
print("Rest of the program continues")
sleep(1)
Thanks for any help in advance :).
argsargument:threading.Timer(time, printX, args=(time, message)).start()-