Python内置的下载服务器 http.server  Python的Web服务器

  1. python2 中SimpleHTTPServer
  2. python3 中 http.server

执行

 python -m http.server

会在当前目录启动一个文件下载服务器,默认打开8000端口

如果当前目录下有index.html文件,默认显示该文件的内容

如果没有,默认显示当前目录下的文件列表

Python Http-server 使用的更多相关文章

  1. Python 处理server返回gzip内容

    Python 如何处理server返回gzip压缩过的内容,代码如下: from StringIO import StringIOimport gzip request = urllib2.Reque ...

  2. 小测几种python web server的性能

    http://blog.csdn.net/raptor/article/details/8038476 因为换了nginx就不再使用mod_wsgi来跑web.py应用了,现在用的是gevent-ws ...

  3. Python Web Server Gateway Interface -- WSGI

    了解了HTTP协议和HTML文档,我们其实就明白了一个Web应用的本质就是: 浏览器发送一个HTTP请求: 服务器收到请求,生成一个HTML文档: 服务器把HTML文档作为HTTP响应的Body发送给 ...

  4. a simple and universal interface between web servers and web applications or frameworks: the Python Web Server Gateway Interface (WSGI).

    WSGI is the Web Server Gateway Interface. It is a specification that describes how a web server comm ...

  5. python socket server源码学习

    原文请见:http://www.cnblogs.com/wupeiqi/articles/5040823.html 这里就是自己简单整理一下: #!/usr/bin/env python # -*- ...

  6. Notes on PEP333 (Python Web Server Gateway Interface)

    This note is about PEP3333- Python Web Server Gateway Interface. Refer to (Source: http://legacy.pyt ...

  7. python web server gateway interface (wsgi ) notes

    前言: 注:如果需要得到支持批Python3.x以及包含了勘误表,附录,和说明的更新版规范,请查看PEP 3333 摘要: 这篇文档详细说明了一套在web服务器与Python web应用程序(web框 ...

  8. Python游戏server开发日记(一)目标

    到了新的环境.老大让我有空研究下一代server技术,作为一个长期任务. 新的server想达到的目标: 1.分布式系统,对象(Entity)之间的关系类似于Actor模型. 2.逻辑服务,是单进程. ...

  9. C# 启动 a Python Web Server with Flask

    概览 最近有个需求是通过c#代码来启动python 脚本.嘿~嘿!!! 突发奇想~~既然可以启动python脚本,那也能启动flask,于是开始着手操作. 先看一波gif图 通过打开控制台启动flas ...

  10. python http server handle json

    用Python实现一个http server # python2 # coding = utf-8 from BaseHTTPServer import HTTPServer, BaseHTTPReq ...

随机推荐

  1. elasticsearch type类型创建时注意项目,最新的elasticsearch已经不建议一个索引下多个type

    https://www.elastic.co/guide/cn/elasticsearch/guide/current/mapping.html如果有两个不同的类型,每个类型都有同名的字段,但映射不同 ...

  2. Java学习之"Hello World"

    好像学习每个程序敲的第一个代码都是"Hello World",而学习Java也不例外,这篇博客就讲一下我学习Java的第一个程序HelloWorld.java 程序代码: publ ...

  3. 深度学习面试题11:池化(same池化、valid池化、带深度的池化)

    目录 Same最大值池化 多深度的same池化 Same平均值池化 Valid池化 参考资料 池化(Pooling)操作与卷积类似,取输入张量的每个位置的矩形领域内的最大值或平均值作为该位置的输出. ...

  4. 关于解决'\u'开头的字符串转中文的方法

    如果字符串是”\u70ed\u95e8\u94ed\u6587\u63a8\u8350”这种形式的字符串: python3的解决办法:字符串.encode(‘utf-8’).decode(‘unico ...

  5. centos 普通用户 和 root 相互切换方法

    root 用户切换为普通用户 :用 login -f username (加 -f 不用输入密码)例如普通用户的用户名为hadoop,这里就是 login -f hadoop 普通用户切换为root用 ...

  6. 图像处理代码举例(C++、MATLAB、OpenCV)

    一.C中用数组存图像信息,下标索引: pbTag[y*newWidth+x] 见:https://www.cnblogs.com/wxl845235800/p/11149853.html HRESUL ...

  7. 海思uboot启动流程详细分析(转)

    海思uboot启动流程详细分析(一) 海思uboot启动流程详细分析(二) 海思uboot启动流程详细分析(三)  

  8. Docs-.NET-C#-指南-语言参考-预处理器指令:#pragma checksum(C# 参考)

    ylbtech-Docs-.NET-C#-指南-语言参考-预处理器指令:#pragma checksum(C# 参考) 1.返回顶部 1. #pragma checksum(C# 参考) 2015/0 ...

  9. Spring cloud微服务安全实战_汇总

    Spring cloud微服务安全实战 https://coding.imooc.com/class/chapter/379.html#Anchor Spring Cloud微服务安全实战-1-1 课 ...

  10. .gitignore 模板

    .gitignore 模板 HELP.md target/ !.mvn/wrapper/maven-wrapper.jar !**/src/main/** !**/src/test/** ### ST ...