3 changed files with 66 additions and 0 deletions
@ -0,0 +1,19 @@ |
|||
import platform |
|||
from flask import Flask, render_template |
|||
|
|||
app = Flask(__name__) |
|||
|
|||
@app.route('/') |
|||
def system_info(): |
|||
system_info = { |
|||
'System': platform.system(), |
|||
'Node Name': platform.node(), |
|||
'Release': platform.release(), |
|||
'Version': platform.version(), |
|||
'Machine': platform.machine(), |
|||
'Processor': platform.processor() |
|||
} |
|||
return render_template('system_info.html', system_info=system_info) |
|||
|
|||
if __name__ == '__main__': |
|||
app.run(debug=True) |
|||
@ -0,0 +1,18 @@ |
|||
/* static/style.css */ |
|||
body { |
|||
font-family: Arial, sans-serif; |
|||
margin: 0; |
|||
padding: 0; |
|||
background-color: #f2f2f2; |
|||
} |
|||
|
|||
header { |
|||
background-color: #333; |
|||
color: white; |
|||
padding: 1em; |
|||
text-align: center; |
|||
} |
|||
|
|||
main { |
|||
margin: 2em; |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
<!-- templates/system_info.html --> |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="UTF-8"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}"> |
|||
<title>System Information</title> |
|||
</head> |
|||
<body> |
|||
<header> |
|||
<h1>System Information</h1> |
|||
</header> |
|||
<main> |
|||
<table> |
|||
<tr> |
|||
<th>Attribute</th> |
|||
<th>Value</th> |
|||
</tr> |
|||
{% for key, value in system_info.items() %} |
|||
<tr> |
|||
<td>{{ key }}</td> |
|||
<td>{{ value }}</td> |
|||
</tr> |
|||
{% endfor %} |
|||
</table> |
|||
</main> |
|||
</body> |
|||
</html> |
|||
Loading…
Reference in new issue