import threading def delayed(): print("Printed after 5 seconds!") thread = threading.Timer(3, delayed) thread.start()