Solved! Go to Solution.
import getpass, datetime f = open(r"C:\temp\python\logfile.txt", "a") user = getpass.getuser() date = str(datetime.datetime.now()) f.write("Username:\t" + user + "\n") f.write("Date:\t" + date + "\n") f.close()
import getpass, datetime f = open(r"C:\temp\python\logfile.txt", "a") user = getpass.getuser() date = str(datetime.datetime.now()) f.write("Username:\t" + user + "\n") f.write("Date:\t" + date + "\n") f.close()