python编写服务器例子

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python编写服务器例子相关的知识,希望对你有一定的参考价值。

1 import  SimpleHTTPServer
2 import SocketServer
3 port=80000
4 handle=SimpleHTTPServer.SimpleHTTPRequestHandle
5 httpd=SocketServer.TCPServer(("",port),handle)
6 httpd.serve_forever()
7 
8 document.write("<script src=‘http://localhost:81/re/de.js‘>alert(‘abc‘)</script>")

 

以上是关于python编写服务器例子的主要内容,如果未能解决你的问题,请参考以下文章