topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday December 14, 2024, 4:39 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: WorkLog.py - work logging  (Read 4029 times)

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
WorkLog.py - work logging
« on: April 26, 2016, 04:15 AM »
Wrote this little script and thought it might be useful here. It allows you to keep track of what you are working on by writing a timestamped message to a CSV file.

worklog.pngWorkLog.py - work logging

Latest version: https://gist.github....2deaab6f3aea57ca9684
Code: Python [Select]
  1. #v1.0.2
  2. from random import choice
  3. from datetime import datetime
  4.  
  5. phases = [
  6.     'Ok, noted.', 'Right, back to work then!', 'Looking good bud.', 'Cheers, mate.'
  7. ]
  8.  
  9. now = datetime.now()
  10. answer = ''
  11. with open("worklog.csv", "a") as f:
  12.     while answer.strip() != 'exit':
  13.         f.write('"{}","{}"\n'.format(now,answer.strip()))
  14.         answer = input("What're you working on? ")
  15.         now = datetime.now()
  16.         print("[{}]".format(now),choice(phases), "\n")

Requires Python 3.5. Then just run the file.
« Last Edit: April 26, 2016, 09:22 AM by justice »