import datetime as dt with open("/tmp/malicious-was-here", "w") as fp: fp.write("I was here at {}".format(dt.datetime.now()))