web.py – helloworld
来源:互联网 发布:市场调研数据分析方法 编辑:程序博客网 时间:2024/05/24 06:54
web.py安装
源码包安装:
git来源: gitclonegit://github.com/webpy/webpy.git webpy
压缩包: wget http://webpy.org/static/web.py-0.38.tar.gz
tar zxvf web.py-0.38.tar.gz
cd web.py-0.38/
sudo python setup.py install
代码库存放在/usr/local/lib/python2.7/dist-packages/web/
该服务器只支持python3以下的版本.
其他方式:
easy_install web.py 或者pipinstall web.py.
helloworld实例
代码:
import web
urls = ("/.*", "hello")
app = web.application(urls, globals())
class hello:
def GET(self):
return'Hello, world!'
if __name__ == "__main__":
app.run()
启动服务:
$ python testcode.py [端口号]
http://0.0.0.0:8080/
127.0.0.1:38731 - - [15/Jul/2016 13:32:53] "HTTP/1.1GET/" - 200 OK
0 0
- web.py – helloworld
- web.py 学习之 helloworld
- Web.py初探:安装与HelloWorld
- web.py的第一个helloworld
- web.py– sessions
- soaplib helloworld.py
- python入门--helloworld.py
- py写HelloWorld
- web.py– URL 处理
- web.py – 网页跳转
- web.py – 子网页
- web.py – xml模版
- web.py– POST反应
- web.py (url.py)
- web.py
- web.py
- web.py
- web.py
- addChildViewController相关api深入剖析
- 带进度条的webview,支持网页前进和返回、刷新,返回键goBack等.
- 【OC】@property的特性
- FloatingActionButtonMenu
- 利用attrs.xml和 styles.xml定义Preference
- web.py – helloworld
- jQuery事件、计算浏览次数
- 常用命令
- Help Jimmy (POJ 1661)
- Amazon的推荐系统
- python xlsxwriter vs openpyxl
- 如何根据实体类关系建表
- PHP 给当前时间加日期
- shell