If I do this
Is there any way to have it so I can pass the command value to the waiting function & have it work properly?
t = threading.Timer(5,waiting(command))
to try and pass the command to my waiting() it ignores the 5sec timer:#------------------------------------------------------------------------------------- # Set Reminders #------------------------------------------------------------------------------------- if ('remind me' in command): command = command.replace("remind me", "") autoTypeAnimation("Ok, I will remind you" + command) import threading t = threading.Timer(5,waiting(command)) t.start() def waiting(command): print("Reminder Set") # Wait 5s then bring up reminder # time.sleep(5) autoTypeAnimation("FYI: I was told to remind you" + command)& it will throw this error:
Error:Commander: Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Users\BX-PC\AppData\Local\Programs\Python\Python39\lib\threading.py", line 973, in _bootstrap_inner
self.run()
File "C:\Users\BX-PC\AppData\Local\Programs\Python\Python39\lib\threading.py", line 1286, in run
self.function(*self.args, **self.kwargs)
TypeError: 'NoneType' object is not callable
But if I do (don't pass the command to the waiting()):#------------------------------------------------------------------------------------- # Set Reminders #------------------------------------------------------------------------------------- if ('remind me' in command): command = command.replace("remind me", "") autoTypeAnimation("Ok, I will remind you" + command) import threading t = threading.Timer(5,waiting) t.start() def waiting(): print("Reminder Set") # Wait 5s then bring up reminder # time.sleep(5) autoTypeAnimation("FYI: I was told to remind you")It works as intended.
Is there any way to have it so I can pass the command value to the waiting function & have it work properly?