使用 Python2 SimpleHTTPServer快速共享文件
利用 Python2 內建的SimpleHTTPServer
(Python3中為http.server
),可以啟動一個http服務,輕鬆快速的實作一個有檔案的目錄的共享,在區域網路環境下尤其實用、方便。
With default port 8000
$ cd $directory
$ python -m SimpleHTTPServer # python2
$ python -m http.server # python3
Serving HTTP on 0.0.0.0 port 8000 ...
With custom port xxxx
$ cd $directory
$ python -m SimpleHTTPServer xxxx # python2
$ python -m http.server xxxx # python3
Serving HTTP on 0.0.0.0 port xxxx ...
See python doc for reference