1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
<?xml version='1.0' encoding='utf-8'?>
<?python #
import os
import sys
import time
uname = os.uname()
try:
getloadavg = os.getloadavg
except AttributeError:
getloadavg = lambda : "(not available)"
?>
<html xmlns:py="http://purl.org/kid/ns#">
<head>
<title>System Information</title>
</head>
<body>
<h1>Kid System Info Demo</h1>
<p>
This file: ${os.path.abspath(__file__)}<br/>
Operating System: <span py:content="os.name"/><br/>
Load: ${repr(getloadavg())}<br/>
Time: <span py:replace="time.strftime('%C %c')"/>
</p>
<h2>Environment</h2>
<table>
<tr py:for="k,v in os.environ.items()">
<td>$k</td>
<td>$v</td>
</tr>
</table>
</body>
</html>
|