build httpserver with python -SimpleHTTPServer

As a developer, we often need to be downloaded from the Internet related SDK and some demo related learning and demonstration, and then slowly write your own. Downloaded the demo and learn information directly through IE browser to open, will find a bunch of errors and BUG not operate properly, you need to put IIS or Tomcat inside to run properly. But if it is just related to some static HTML files and js to put to put to how much trouble;, or we want to copy some files to this machine from another machine, and no U disk or copy something from Linux , but also thinking to get ftp like trouble. So the python quickly establish a HttpServer is very convenient.

 

Such as we often use OpenLayers directly use the browser to open, it may be because some XMLHttpRequest problem lead to demo demo. It is more convenient to enter the command line demo corresponding folder, then enter:

python -m SimpleHTTPServer

 

 

 

This will prompt you Serving HTTP on 0.0.0.0 port 8000, open the browser normally browse Demo. Related to some of the files in the directory can be downloaded via Http protocol, copy files is also a good choice.

本文固定链接: http://www.higis.org/en/2012/09/28/python-simplehttpserver/ | Hi,GIS


该日志由 H.J 于2012年09月28日发表在 Program 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: build httpserver with python -SimpleHTTPServer | Hi,GIS
关键字: ,

build httpserver with python -SimpleHTTPServer:等您坐沙发呢!

发表评论

快捷键:Ctrl+Enter