在CentOS6.5上面安装web.py
wget http://webpy.org/static/web.py-0.37.tar.gz
tar -zxf web.py-0.37.tar.gz
cd web.py-0.37
python setup.py install
cd web
编辑code.py
vim code.py
import web
urls = ("/.*", "hello")
app = web.application(urls, globals())
class hello:
def GET(self):
return 'Hello,World!'
if __name__ == "__main__":
app.run()
保存
运行python code.py可以实现8080访问!
[root@localhost web]# python code.py
http://0.0.0.0:8080/