22.executor service Flask

pip包管理器 没有npm那么强大 不支持 npm --save install 这样的方法

但是我们有别的方法

安装Flask

但是呢

我们不能把它存放在package .json

那就需要我们自己装就很烦

不如我们

 npm --save install方便

我们自己来实现

我们即将我们的依赖关系写入一个文件

然后我们用  pip install -r +文件名 

来执行文件

 

然后我们

The directory '/home/han/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/han/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: Flask in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 1))
Requirement already satisfied: Werkzeug>=0.14 in /usr/local/lib/python2.7/dist-packages (from Flask->-r requirements.txt (line 1))
Requirement already satisfied: click>=5.1 in /usr/local/lib/python2.7/dist-packages (from Flask->-r requirements.txt (line 1))
Requirement already satisfied: Jinja2>=2.10 in /usr/local/lib/python2.7/dist-packages (from Flask->-r requirements.txt (line 1))
Requirement already satisfied: itsdangerous>=0.24 in /usr/local/lib/python2.7/dist-packages (from Flask->-r requirements.txt (line 1))
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python2.7/dist-packages (from Jinja2>=2.10->Flask->-r requirements.txt (line 1))
result

发现他去尝试安装Flask

 

以后我们就将安装的东西放在里面 他会一行行执行

 

 

python里面是没有大括号的

里面的逻辑就是靠换行 空格或者TAP来确定的

一定要注意

 

把他启动

127.0.0.1就是localhost

 

我们用postman来看看能不能work

 

 说明Flask运作正常

那么我们Flask有没有类似

nodemon或者ng build --watch这种

只要修改代码就会自动更新重启的方法

有的你只要

加入一个参数

我们来修改文件试试

然后postman

发现没变化

其实第一次需要我们手动执行一次

因为我的debug关了

那么我们手动执行一次

然后我们再postman

 

转载于:https://www.cnblogs.com/PoeticalJustice/p/9493794.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值