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! 字段

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