-1
這裏是我的代碼Python中的http服務器:我試圖創建一個使用SimpleHTTPServer並獲得錯誤
import SocketServer
import SimpleHTTPServer
class HttpRequestHandler(SimpleHTTPServer.SimpleHttpRequestHandler) :
def do_GET(self) :
if self.path == '/admin' :
print "This page is only for admins"
else :
SimpleHTTPServer.SimpleHttpRequestHandler(self)
addr = (('0.0.0.0',10001))
httpServer = SocketServer.TCPServer(addr,HttpRequestHandler)
httpServer.serve_forever()
我收到錯誤'module' object has no attribute 'SimpleHttpRequestHandler'
,爲什麼發生這個錯誤?
在此先感謝