I'm trying to write a simple server in python. So after watching tutorial, I'm trying to import a few modules.
from http.server import HTTPServer
from http.server import SimpleHTTPServer
As the doc says, it has been moved, that's why i'm doing so.
But it gives me this error : from http.server import SimpleHTTPServer ImportError: cannot import name 'SimpleHTTPServer'
And without SimpleHTTPServer
I can't use SimpleHTTPRequestHandler
, as it is defined in SimpleHTTPServer.SimpleHTTPRequestHandler
.
How can I resolve this ?
SimpleHTTPServer
was moved to be the modulehttp.server
. You want to use the request handler classBaseHTTPRequestHandler
. From the docs. – Mannikin