News for hackers. Stuff that matters.
Re:Keeping a plaintext “did” file by corny on Monday July 16, 2018 @03:43PM (#17544398)
Thanks - this is cleaner than what I was using for something similar. Here's my version:

  import datetime
  user_input = raw_input("Log entry: ")
  with open("did.log", "a") as timelog:
      timelog.write('\n')
      timelog.write(datetime.datetime.now().strftime("%Y-%m-%d %H:%M (%a)"))
      timelog.write(': ')
      timelog.write(user_input)

There are no comments on this comment yet.