python SimpleHTTPServer 2

1: 创建一个html文件

代码为 Hello World!

文件名为:index.html


2: 创建一个test.py文件

代码为: improt SimpleHTTPServer

SimpleHTTPServer.test();


3: 命令提示符下,跳转到test.py文件所在的目录

输入 python test.py

4:会出现这样的字段 Serving HTTP on 0.0.0.0 port 8000 ...


5:在浏览器中输入 http://localhost:8000/

会出现Hello World! 字段

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章