- 博客(4)
- 资源 (1)
- 收藏
- 关注
原创 python __getattr__, __getattribute__,__get__的用法
class C(object): a = 'abc' def __getattribute__(self, *args, **kwargs): print("__getattribute__() is called") return object.__getattribute__(self, *args, **kwargs) def __getattr__...
2019-04-23 14:33:33 154
原创 OpenStack 关于admin-openrc.sh的作用(Queens版本)
在许多安装文档中,都要source admin-openrc.sh。那么这一步具体有什么用呢?还是要从代码看起。不执行source admin-openrc.sh,直接执行neutron port-list会出现以下错误:Auth plugin requires parameters which were not given: auth_urlneutron port-list的入口...
2019-04-18 16:15:58 12152
原创 python常用的工具函数
1.zip:接受任意多个(包括0个和1个)序列作为参数,返回一个tuple列表。如:a = [1,2]b = [3,4]c = dict(zip(a, b))print c结果:{1: 3, 2: 4}2.利用contextlib创建一个上下文管理器from contextlib import contextmanager@contextmanagerde...
2019-04-09 23:01:42 119
原创 Content-Type, Data-Type
1.在jquery的ajax中,如果没加contentType:"application/json",那么data就应该对应的是json object(否则报错);反之,如果加了contentType:"application/json",那么ajax发送的就必须是字符串(否则报错)。2.$.ajax contentType 和 dataType , contentType 主要设置你发送给服...
2019-04-08 17:21:22 243
OpenStack icehouse版本配置说明手册
2018-11-06
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人