美文网首页Python
[Python] -m SimpleHTTPServer错误:"

[Python] -m SimpleHTTPServer错误:"

作者: _小老虎_ | 来源:发表于2020-03-11 14:31 被阅读0次

如果非常需要临时起一个http server,但是用simpleHttpServer报No module错误,
可以临时用这个issue的方法:https://github.com/garrett/magicmockup/issues/1



直接写一个 srv.py

import SimpleHTTPServer
import SocketServer
PORT = 8000
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer(("", PORT), Handler)
print "serving at port", PORT
httpd.serve_forever()

之后
python srv.py


这个问题可能是Python编译导致的

相关文章

网友评论

    本文标题:[Python] -m SimpleHTTPServer错误:"

    本文链接:https://www.haomeiwen.com/subject/jakcjhtx.html