您的位置:首页 > 编程语言 > Python开发

python3自带web服务器

2015-07-11 22:28 537 查看
利用python建立小型的web站点

1.首先创建做服务器的文件夹

2.将html文件放在该文件夹下,在该文件夹下执行以下命令

python2.7

python -m SimpleHTTPServer 端口


python3.4

python -m http.server 端口


3.访问

本机:

http://localhost:端口/xxx.html http://127.0.0.1:端口/xxx.html[/code] 
同网段下其他PC

http://本机ip:端口/xxx.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python web服务器