我如何只simplehttpwebsite_content.html
在访问时显示localhost:8080
?所以我看不到我的文件树,只有网页。所有这些文件都在同一个目录中。
简单的httpwebsite.py
#!/usr/bin/env python
import SimpleHTTPServer
import SocketServer
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
server = SocketServer.TCPServer(('0.0.0.0', 8080), Handler)
server.serve_forever()
简单的httpwebsite_content.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="simplehttpwebsite_style.css">
</head>
<body>
This is my first web page
</body>
</html>
简单的httpwebsite_style.css
body{background-color:blue;}