python快速搭建WebServer
#!/usr/bin/python
import SimpleHTTPServer
import SocketServer
import os PORT = 7777
WEBDIR = "/www/web/xxx_com/" class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def translate_path(self, path):
os.chdir(WEBDIR)
return SimpleHTTPServer.SimpleHTTPRequestHandler.translate_path(self,path) try:
httpd = SocketServer.TCPServer(("", PORT), Handler)
print "dir %s serving at port %s"%(repr(WEBDIR), PORT)
httpd.serve_forever()
except:pass
python快速搭建WebServer的更多相关文章
- 使用 python快速搭建http服务
在 Linux 服务器上或安装了 Python 的机器上,Python自带了一个WEB服务器 SimpleHTTPServer. 我们可以很简单的使用 python -m SimpleHTTPSer ...
- python快速搭建http服务
在Windows 7/10或Ubuntu上可以通过python2.x或python3.x来快速搭建一个简单的HTTP服务器. 如果python为2.x,则可执行:$ python -m SimpleH ...
- 用python快速搭建WEB服务器
cmd下进入你要搞WEB项目的目录 输入↓方代码 python -m SimpleHTTPServer 端口号# 默认是8000 这样就启动了一个简单的WEB服务器
- 使用python快速搭建本地网站
如果你急需一个简单的Web Server,但你又不想去下载并安装那些复杂的HTTP服务程序,比如:Apache,ISS,Nodejs等.那么, Python 可能帮助你.使用Python可以完成一个简 ...
- 使用python快速搭建web服务器
命令:python -m SimpleHTTPServer 8088 参考:https://www.cnblogs.com/harry-xiaojun/p/6739003.html https://w ...
- python 快速搭建文件服务器
以http方式共享当前文件夹的文件 可实现跨平台文件传输 只需要一句话搞定 #python -m SimpleHTTPServer 8001 浏览器中输入 http://ip:8001 显示所有文件 ...
- PJzhang:python快速搭建局域网文件共享服务器
猫宁!!! 参考链接:https://www.cnblogs.com/nopnog/p/8116848.html https://www.cnblogs.com/yili16438/p/d320932 ...
- 使用python快速搭建http服务
python2语法:python -m SimpleHTTPServer python3语法:python -m http.server 在局域网中使用web去访问http:/IP:8000即可 可以 ...
- Python快速搭建HTTP服务器
<wiz_tmp_tag id="wiz-table-range-border" contenteditable="false" style=&q ...
随机推荐
- linux 文件查找和压缩工具
文件查找 1,which命行查找可执行文件,which 只会搜索系统$PATH目录 2,whereis,查找可执行文件,并显示出此文件的man page文件,并且可以查找到系统的库目录 3,locat ...
- centos在安装apache2.4版本的时候遇到ARP not found解决办法
今日编译apache时出错: #./configure --prefix……检查编辑环境时出现: checking for APR... noconfigure: error: APR not fou ...
- mysql 5.7 内存使用监控
5.7 中的performance_schema 已经有能力监控mysql 的内存使用情况了,对于这一点也是要通过instrument 来实现的,由于内存这一块没有对应的consumer 所以只要 配 ...
- [iOS常见问题] 关于使用QQ做第三方登录的问题!
[iOS常见问题] 关于使用QQ做第三方登录的问题! 注意:QQ本身没有授权功能,所以想要使用QQ做第三方登录必须通过QQ空间来实现! 第一步:集成ShareSDK(步骤同集成分享的一样,如果已经集成 ...
- [Google Code Jam (Qualification Round 2014) ] B. Cookie Clicker Alpha
Problem B. Cookie Clicker Alpha Introduction Cookie Clicker is a Javascript game by Orteil, where ...
- C语言实现OOP 版本2
写版本2的原因,还是发现在不同的具体图形模块里发现了重复的release代码,这是坏味道,所以还是决定消除这些重复代码,DRY! shape.h #ifndef SHAPE_H #define SHA ...
- 关于cookie, iphone及chrome的异同
http://www.blogjava.net/jjshcc/archive/2010/06/13/323517.html http://stackoverflow.com/questions/295 ...
- XJOI网上同步训练DAY2 T2
[问题描述] 火车司机出秦川跳蚤国王下江南共价大爷游长沙.每个周末勤劳的共价大爷都会开车游历长沙市. 长沙市的交通线路可以抽象成为一个
- LeetCode_Permutations
Given a collection of numbers, return all possible permutations. For example, [1,2,3] have the follo ...
- LeetCode_Palindrome Partitioning
Given a string s, partition s such that every substring of the partition is a palindrome. Return all ...