Reputation: 319
import threading
import time
import os
def clearAfter15():
clear = lambda: os.system('clear/cls')
clear()
string_variable="This message will be disappear after 1 minutte"
t = threading.Timer(1*60, clearAfter15)
t.start()
print(string_variable)
Expected : After 1 minute the output will get disappeared from the console
Upvotes: 0
Views: 70
Reputation:
Try this:
def clearAfter15():
clear = lambda: os.system('cls' if os.name == 'nt' else 'clear')
clear()
Upvotes: 1