xiumusheng

 

 

访问web.py官网 http://webpy.org/

SGHBNNIT]}54B}0K8@}GDTW

根据网站步骤,利用 pip install web.py

若没有 PIP

则先安装pip

运行 

sudo apt-get install python-pip

image

网站安装python 2 ,运行python 3 则需要

pip install web.py==0.40-dev1

编写 myweb.py运行脚本
 import web        
 urls = (
     \'/(.*)\', \'hello\'
 )
 app = web.application(urls, globals())

 class hello:        
     def GET(self, name):
         if not name: 
             name = \'World\'
         return \'Hello, \' + name + \'!\'

 if __name__ == "__main__":
     app.run()
利用python myweb.py 运行这个脚本 开启服务 
也可加后面加入IP 和端口
 
 

分类:

技术点:

相关文章:

  • 2021-08-03
  • 2021-04-23
  • 2022-02-09
  • 2021-08-11
  • 2021-11-30
  • 2022-12-23
  • 2021-12-15
  • 2021-11-27
猜你喜欢
  • 2021-11-01
  • 2022-12-23
  • 2021-05-08
  • 2021-09-29
  • 2021-09-03
相关资源
相似解决方案