使用Python建立臨時網頁伺服器

切換到網頁目錄

cd \PathToDir

執行Server

#Python3.x版本python -m http.server      #預設port在8000 
python -m http.server 80 #改至port 80
python -m http.server --bind [IP/HOSTNAME] [PortNumber] #綁定IP與Port
#Python2.x版本
python -m SimpleHTTPServer #預設port在8000
python -m SimpleHTTPServer 80 #改至port 80

查看

http://127.0.0.1:8000/
或者
http://localhost:8000/

關閉伺服器

Ctrl+C

Written by

Machine Learning / Deep Learning / Python / Flutter cakeresume.com/yanwei-liu

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store