Will Dx

人世一身霜雪, 归来仍是少年.

python小脚本04-标准库lpthw建立简单web

Posted April 07, 2017

1.切换到系统自带的版本python2.7

Python
pyenv global system

2.安装lpthw.web库

Python
pip install lpthw.web

3.程序代码

Python
# -*- coding: utf-8 -*-
'''
File Name: app.py
Author: WillDX
mail: xiang.dai@shuyun.com
Created Time: 四  6/30 16:39:30 2016
'''
import web


urls = ('/','index')

app = web.application(urls,globals())

class index:
    def GET(self):
        greeting ="Hello World"
        return greeting

if __name__=="__main__":
    app.run()

4.运行

Python
python  app.py