To develop a simple webserver to serve html pages and display the configuration details of laptop.
HTML content creation.
Design of webserver workflow.
Implementation using Python code.
Serving the HTML pages.
Testing the webserver.
''' content='''
<title>My Laptop Specifications</title> <style> body { font-family: Arial, sans-serif; background-color: #f4f4f4; color: #333; max-width: 600px; margin: 20px auto; padding: 20px; border: 2px solid #ccc; border-radius: 10px; } h1 { color: #0066cc; text-align: center; } ul { list-style-type: none; padding: 0; } li { background: #fff; margin: 10px 0; padding: 10px; border-radius: 5px; box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); } .highlight { font-weight: bold; color: #333; } </style>Below are the specifications of my Lenovo ThinkPad laptop:
- Brand: Lenovo ThinkPad
- Processor: Intel Core i5 / i7 (Choose based on your model)
- RAM: 8GB / 16GB DDR4
- Storage: 256GB / 512GB SSD
- Graphics: Integrated Intel UHD / Intel Iris Xe
- Display: 14-inch Full HD (1920x1080)
- Operating System: Windows 10 / 11 or Linux
- Battery Life: Up to 12 hours
- Weight: Approx. 1.5 kg
This Lenovo ThinkPad is known for its robust build quality, excellent keyboard, and reliable performance, making it ideal for work and productivity tasks.
'''
class MyServer(BaseHTTPRequestHandler):
def do_GET(self):
print("Get request received...")
self.send_response(200)
self.send_header("content-type", "text/html")
self.end_headers()
self.wfile.write(content.encode())
print("This is my webserver") server_address =('',8000) httpd = HTTPServer(server_address,MyServer) httpd.serve_forever()
'''
The program for implementing simple webserver is executed successfully.