Python question
Paul Lussier
p.lussier at comcast.net
Tue Jan 13 14:45:16 EST 2009
"Steven W. Orr" <steveo at syslang.net> writes:
> Guys, don't use time! Use the datetime interface I previously
> described. That's what it was made for. :-)
>
> #! /usr/bin/python
> import datetime
> import time
>
> then = datetime.datetime.now()
> print "then = ", then
>
> time.sleep(5)
>
> now = datetime.datetime.now()
> print "now = ", now
>
> print "Elapsed = ", now - then
Doh! <sound of hand smacking head>
I saw this in the modules reference, but simply didn't grok it at the time.
This is *exactly* what I want to do!
Thanks!
--
Seeya,
Paul
More information about the gnhlug-discuss
mailing list