A cross-platform uptime for the Python. To install it, just do:
$ pip install uptime
Then just use it like this:
from uptime import uptime print uptime()
Or run the module as a script:
$ python -m uptime Uptime: 109 days, 33.84 seconds. $ python -m uptime -b Booted: Wed Oct 10 06:28:24 2012 CET.
(You may need to use
uptime.__main__, depending on your version of Python.)
Full documentation here. Works with any version of Python from 2.5 on, including Python 3.
Tested on a bunch of platforms, expected to work on a bunch more. See the documentation for details.