|python提供restful服务

|python提供restful服务

文章图片


1. 使用Anaconda安装Python环境;
2. 新建py文件(例如:restapi.py)
引入第三方flask包 , Anaconda环境中已经包含 , 使用即可!

3. 服务启动
nohup python restapi.py &
4.验证
当在浏览器上录入:http://ip:5000/ , 回车 , 就能返回“Hello World!”
【|python提供restful服务】


    推荐阅读