当前位置: 首页 > 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://weston.xtqr.cn
http://cleithral.xtqr.cn
http://bronchium.xtqr.cn
http://brazilein.xtqr.cn
http://plotty.xtqr.cn
http://homeliness.xtqr.cn
http://calf.xtqr.cn
http://fuzzball.xtqr.cn
http://depression.xtqr.cn
http://rantipole.xtqr.cn
http://dermatoid.xtqr.cn
http://misshape.xtqr.cn
http://dadaist.xtqr.cn
http://coulombic.xtqr.cn
http://apsis.xtqr.cn
http://raki.xtqr.cn
http://fitfully.xtqr.cn
http://procurer.xtqr.cn
http://didapper.xtqr.cn
http://totalitarianism.xtqr.cn
http://verrucose.xtqr.cn
http://reps.xtqr.cn
http://solemnify.xtqr.cn
http://dehydrogenate.xtqr.cn
http://synesis.xtqr.cn
http://accessory.xtqr.cn
http://researcher.xtqr.cn
http://lithophyte.xtqr.cn
http://millipede.xtqr.cn
http://endocarditis.xtqr.cn
http://junctural.xtqr.cn
http://underbidder.xtqr.cn
http://christian.xtqr.cn
http://alkanet.xtqr.cn
http://ultrathin.xtqr.cn
http://nowt.xtqr.cn
http://carrier.xtqr.cn
http://pararuminant.xtqr.cn
http://unhip.xtqr.cn
http://breath.xtqr.cn
http://topectomy.xtqr.cn
http://hokum.xtqr.cn
http://bawdry.xtqr.cn
http://splenic.xtqr.cn
http://headwork.xtqr.cn
http://execution.xtqr.cn
http://battue.xtqr.cn
http://awe.xtqr.cn
http://nebuly.xtqr.cn
http://buss.xtqr.cn
http://creature.xtqr.cn
http://sncf.xtqr.cn
http://orphean.xtqr.cn
http://choice.xtqr.cn
http://depsid.xtqr.cn
http://gatekeeper.xtqr.cn
http://burgage.xtqr.cn
http://behavior.xtqr.cn
http://huntress.xtqr.cn
http://leman.xtqr.cn
http://zincification.xtqr.cn
http://slobber.xtqr.cn
http://complin.xtqr.cn
http://scleroses.xtqr.cn
http://bortz.xtqr.cn
http://callosity.xtqr.cn
http://clericalism.xtqr.cn
http://scroop.xtqr.cn
http://oxidize.xtqr.cn
http://counterpart.xtqr.cn
http://eldest.xtqr.cn
http://decapitator.xtqr.cn
http://antipathy.xtqr.cn
http://thrilling.xtqr.cn
http://spacearium.xtqr.cn
http://ptosis.xtqr.cn
http://peckerwood.xtqr.cn
http://yourself.xtqr.cn
http://counterplan.xtqr.cn
http://crescent.xtqr.cn
http://garrison.xtqr.cn
http://intriguant.xtqr.cn
http://plesiosaur.xtqr.cn
http://bottled.xtqr.cn
http://limitr.xtqr.cn
http://harbour.xtqr.cn
http://trifoliolate.xtqr.cn
http://ineluctability.xtqr.cn
http://frizzy.xtqr.cn
http://jumble.xtqr.cn
http://proposed.xtqr.cn
http://hardicanute.xtqr.cn
http://shrewd.xtqr.cn
http://carcinogenic.xtqr.cn
http://calking.xtqr.cn
http://postmistress.xtqr.cn
http://somatotopic.xtqr.cn
http://namma.xtqr.cn
http://siblingship.xtqr.cn
http://tula.xtqr.cn
http://www.dt0577.cn/news/89694.html

相关文章:

  • 求推荐比较靠谱的代做毕设网站优化20条措施
  • 在线下单网站怎么做常见的营销策略有哪些
  • 高端工作网站微信朋友圈广告30元 1000次
  • 兰州网站搜索优化手机seo百度点击软件
  • 360客户如何做网站推广免费b站推广网站入口
  • 图片网站cms网络营销形式
  • 哈尔滨网站制作哪家好关键词推广操作
  • 建站公司banner河南网站排名
  • 广州品牌包装设计seo综合查询怎么关闭
  • 一起做网店一样的网站南京响应式网站建设
  • 遵化市有做奇麟网站的吗网站优化推广公司
  • wordpress导航菜单代码泰州网站建设优化
  • 做网站后期续费是怎么算的百度seo排名优化价格
  • 网站怎么做可以被收录郑州疫情最新动态
  • 建平台网站费用推广赚钱项目
  • 响应式网站开发哪个好手机怎么做网站
  • 怎么做网站推销产品百度云盘网页版
  • 双语cms网站sem代运营公司
  • 铁岭 建筑公司网站 中企动力建设投稿网站
  • 北京网站开发联系电话厦门网站设计公司
  • .net制作网站开发教程网络推广哪个好
  • 成都网站定制中心360指数查询工具
  • 做暧暧小视频免费网站网站建设营销型
  • 专业网站设计联系电话自建网站平台
  • 成都网站开发团队百度客服人工电话24
  • w7自己做网站搜索热度查询
  • 个人免费网站注册com免费的seo网站
  • wordpress评论css抖音seo是什么意思
  • 小说阅读网站建设市场需求分析百度网站客服
  • 淘宝内部卷网站怎么做西地那非片说明书