~mgedmin/gtimelog/ehabkost-integration

« back to all changes in this revision

Viewing changes to scripts/timelog.py

  • Committer: mg
  • Date: 2008-04-22 16:43:53 UTC
  • Revision ID: svn-v4:097e82c0-97e3-0310-a93d-98bb3a55b02b::90
Restructure the source tree: move everything essential into src/ and everything
obsolete into scripts/.  Make 'python setup.py test' run the test-suite.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
import datetime
 
3
import readline
 
4
 
 
5
f = open("timelog.txt", "a")
 
6
print >> f
 
7
f.close()
 
8
 
 
9
while True:
 
10
    try:
 
11
        what = raw_input("> ")
 
12
    except EOFError:
 
13
        print
 
14
        break
 
15
    ts = datetime.datetime.now()
 
16
    line = "%s: %s" % (ts.strftime("%Y-%m-%d %H:%M"), what)
 
17
    print line
 
18
    f = open("timelog.txt", "a")
 
19
    print >> f, line
 
20
    f.close()
 
21