import datetime
current_time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
log_entry = "The program was last run on - {}\n".format(current_time)
with open("code_tanwi.txt", "a") as file:
    file.write(log_entry)
