from datetime import datetime, timedelta
start = datetime.now()
if datetime.now() - start() > timedelta(seconds=5):
'datetime.datetime' object is not callable
the problem in the 'if' string. Thanks if you can help me.
from datetime import datetime, timedelta
start = datetime.now()
if datetime.now() - start() > timedelta(seconds=5):
'datetime.datetime' object is not callable
the problem in the 'if' string. Thanks if you can help me.
You should not write parenthesis for the start:()
from datetime import datetime, timedelta
start = datetime.now()
if datetime.now() - start > timedelta(seconds=5):
# …
pass
start is a datetime object, and it does not make much sense to perform a function call on a datetime object.