no module named http.server

前端 未结 3 1365
南旧
南旧 2021-02-02 10:04

here is my web server class :

import http.server  
import socketserver

class WebHandler(http.server.BaseHTTPRequestHandler):

    def parse_POST(self):
                 


        
3条回答
  •  广开言路
    2021-02-02 10:46

    http.server only exists in Python 3. In Python 2, you should use the BaseHTTPServer module:

    from BaseHTTPServer import BaseHTTPRequestHandler
    

    should work just fine.

提交回复
热议问题