当前位置: 首页 > news >正文

零起飞网站建设工作室关键词优化排名要多少钱

零起飞网站建设工作室,关键词优化排名要多少钱,购买模板做网站,高安网站找工作做面点事python的http.server模块用于HTTP服务器的功能,这个模块是python标准库的一部分,不需要pip install。 使用前需要import: import http.server 然后就可以编辑代码,使用此模块提供的接口,实现http server相关功能。 除…

python的http.server模块用于HTTP服务器的功能,这个模块是python标准库的一部分,不需要pip install。

使用前需要import:

import http.server

然后就可以编辑代码,使用此模块提供的接口,实现http server相关功能。

除此之外,在命令行里直接通过模块方式运行,也可以启动一个http服务器。说明如下。

可以使用解释器的 -m 开关直接调用 http.server。这将为相对于当前目录的文件提供服务:

http.server can be invoked directly using the -m switch of the interpreter. This serves files relative to the current directory:

python -m http.server

服务器默认监听 8000 端口。可以通过将所需的端口号作为参数来覆盖默认值:

The server listens to port 8000 by default. The default can be overridden by passing the desired port number as an argument:

python -m http.server 9000

默认情况下,服务器会将自己绑定到所有接口。选项 -b/--bind 可指定服务器应绑定的特定地址。支持 IPv4 和 IPv6 地址。例如,以下命令会使服务器只绑定到 localhost:

By default, the server binds itself to all interfaces. The option -b/--bind specifies a specific address to which it should bind. Both IPv4 and IPv6 addresses are supported. For example, the following command causes the server to bind to localhost only:

python -m http.server --bind 127.0.0.1

3.4 版中更改: 添加了 --bind 选项。

3.8 版中更改: 在 --bind 选项中支持 IPv6。

Changed in version 3.4: Added the --bind option.

Changed in version 3.8: Support IPv6 in the --bind option.

默认情况下,服务器使用当前目录。选项-d/--directory指定了服务器提供文件的目录。例如,以下命令使用了一个特定目录:

By default, the server uses the current directory. The option -d/--directory specifies a directory to which it should serve the files. For example, the following command uses a specific directory:

python -m http.server --directory /tmp/

3.7 版中更改:添加了 --directory 选项。

Changed in version 3.7: Added the --directory option.

默认情况下,服务器符合 HTTP/1.0。选项 -p/--protocol 指定了服务器所遵从的 HTTP 版本。例如,下面的命令运行一个 HTTP/1.1 兼容服务器:

By default, the server is conformant to HTTP/1.0. The option -p/--protocol specifies the HTTP version to which the server is conformant. For example, the following command runs an HTTP/1.1 conformant server:

python -m http.server --protocol HTTP/1.1

3.11 版中更改:添加了 --protocol 选项。

Changed in version 3.11: Added the --protocol option.

在浏览器中输入IP地址和端口号,就能够访问HTTP服务器了。

参考:

http.server — HTTP servers — Python 3.12.7 documentation

http://www.ds6.com.cn/news/88815.html

相关文章:

  • 做网站先建立模型北京seo网站管理
  • 营销型网站建设设计6竞价托管服务公司
  • 怎么做好手机网站开发长沙网站推广有哪些啊
  • 招标网站都有哪些网络销售怎么做才能做好
  • 沂南建设局网站目前推广平台都有哪些
  • 一个公司可以做两个网站吗网络营销技巧和营销方法
  • 成都网站设计定制百度平台推广的营销收费模式
  • 网站开发培训多少钱网站建设高端公司
  • pc网站建设怎么做百度竞价推广效果好吗
  • 威海做企业网站的公司百度在线扫题入口
  • 织梦做的网站手机打不开百度小说搜索风云榜总榜
  • 数据分析网页安卓aso优化排名
  • 免费创建网站 优帮云百度搜索网站优化
  • 宁波网站建设公司建网站用什么软件
  • 苏州网站建设推广咨询平台seo谷歌外贸推广
  • 新塘做网站公司营销型网站是什么意思
  • 网站建设内容介绍推广任务接单平台
  • 学做网站在哪里大型网站seo课程
  • 1000元能否做网站seo优化网站词
  • 开发公司完工后的维修账务处理seo外链推广
  • 做外贸上不了国外网站如何做推广引流赚钱
  • wordpress如何替换掉网址北京seo方法
  • wordpress单位内网做网站中国新闻网发稿
  • 网站建设同步视频营销策略有哪些内容
  • 网站建设步骤与时间表百度指数大数据
  • 英文网站建设之后怎么推天津seo优化公司哪家好
  • 辛集做网站百度竞价优缺点
  • 阿里云网站的logo怎么写进去的百度助手官网
  • 学做蛋糕网站唐山百度提升优化
  • 佛山建设外贸网站公司吗省委副书记