View Single Post
EmaNymton's Avatar
Posts: 141 | Thanked: 267 times | Joined on May 2010 @ Germany
#564
And the python version

Code:
#!/usr/bin/python
# Show Device Uptime in decimal days

sc = u"\u2622"
seconds = int(float(open('/proc/uptime').read().split()[0]))
days = float(seconds)/float(60*60*24)
days = "{0:.0f}".format(days) if seconds >= 864000 else "{0:.1f}".format(days)
output = " ".join(['up:',days.replace('.', ','),'d',sc.encode('utf-8')])
print output

Last edited by EmaNymton; 2013-01-27 at 15:30.
 

The Following 2 Users Say Thank You to EmaNymton For This Useful Post: