Skip to content
Back to top
View this page
Edit this page

# xonsh.xoreutils.uptime

Provides a cross-platform way to figure out the system uptime.

Should work on damned near any operating system you can realistically expect to be asked to write Python code for. If this module is invoked as a stand-alone script, it will print the current uptime in a human-readable format, or display an error message if it can’t, to standard output.

This file was forked from the uptime project: https://github.com/Cairnarvon/uptime Copyright (c) 2012, Koen Crolla, All rights reserved.

xonsh.xoreutils.uptime.boottime() → float

  Returns boot time if remotely possible, or None if not.

xonsh.xoreutils.uptime.main(args=None)

xonsh.xoreutils.uptime.uptime(args)

  Returns uptime in seconds if even remotely possible, or None if not.