您的位置:首页 > 理论基础 > 计算机网络

when i run server i got "name 'http' is not defined" after import h 4000 ttp.server then i got this "no mo

2016-05-16 18:59 465 查看
http.server only exists in Python 3. In Python 2, you should use the
BaseHTTPServer module:
from BaseHTTPServer import BaseHTTPRequestHandler
should work just fine.
so if you run in py3 is ok

在Python 3.x中,BaseHTTPServer, SimpleHTTPServer, CGIHTTPServer整合到http.server包,SocketServer改名为socketserver,请注意查阅官方文档。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python