Peter Hansen wrote:


I believe there is, though I can't guarantee this is a valid approach:

 >>> import datetime
 >>> import os
 >>> def uptime():
...   t = os.stat('c:/pagefile.sys').st_mtime
...   td = datetime.datetime.now() - datetime.datetime.fromtimestamp(t)
...   return td
...
 >>> print uptime()
12 days, 20:21:17.491000

(matches results of Bengt's and Fredrik's two approaches
two within a minute or so)

Wow .. this seems to work off-the-bat, thanks a lot!!

Esmail
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to