码迷,mamicode.com
首页 >  
搜索关键字:dict    ( 5061个结果
python cookbook第三版学习笔记十二:类和对象(三)创建新的类或实例属性
先介绍几个类中的应用__getattr__,__setattr__,__get__,__set__,__getattribute__,。 __getattr__:当在类中找不到attribute的时候,会调用__getattr__,并执行其中的自定义代码。所有在类中定义的属性都包含在__dict__ ...
分类:编程语言   时间:2017-07-22 12:02:47    阅读次数:165
Translate Exercises(4)
周五翻译课记录。 (1)and it is imagined by many that the operations of the common mind can be by no means compared with theseprocesses, and that they have to b ...
分类:其他好文   时间:2017-07-22 09:48:05    阅读次数:153
迭代器
我们已经知道,可以直接作用于for循环的数据类型有以下几种: 一类是集合数据类型,如list、tuple、dict、set、str等; 一类是generator,包括生成器和带yield的generator function。 这些可以直接作用于for循环的对象统称为可迭代对象:Iterable。 ...
分类:其他好文   时间:2017-07-21 23:09:10    阅读次数:245
swift3.0 存取json数据到沙盒
do { //将json保存到本地 let jsonData = try JSONSerialization.data(withJSONObject: dict, options: .prettyPrinted) // here "jsonData" is the dictionary encode ...
分类:编程语言   时间:2017-07-21 18:55:32    阅读次数:527
cURL资源的初步使用
PHP支持的由Daniel Stenberg创建的libcurl库允许你(模拟)与各种的服务器使用各种类型的协议进行连接和通讯。libcurl目前支持http、https、ftp、gopher、telnet、dict、file和ldap协议。libcurl同时也支持HTTPS认证、HTTP POST ...
分类:Web程序   时间:2017-07-21 01:12:33    阅读次数:187
字典的定义和操作 (Python)
字典是由key and value 构成,无序结构(不想列表那样有固体位置); note:key 是唯一的,没有重复; 字典可以多级嵌套; 定义: 操作:单级的操作 操作:多级简单操作 操作3:多级复杂操作 总结1: 操作类型一: 总结2 操作类型二:dict.XXXX 类型比较繁杂: 单级词典;多 ...
分类:编程语言   时间:2017-07-19 23:37:39    阅读次数:279
python decorator 基础
转自:http://www.cnblogs.com/xybaby/p/6274187.html 一般来说,装饰器是一个函数,接受一个函数(或者类)作为参数,返回值也是也是一个函数(或者类)。首先来看一个简单的例子: # -*- coding: utf-8 -*- 2 def log_cost_tim ...
分类:编程语言   时间:2017-07-19 23:35:05    阅读次数:287
第五章例题
1 #include 2 #include 3 #include 4 #include 5 6 using namespace std; 7 8 set dict; 9 10 int main() 11 { 12 string s,buf; 13 14 while(cin>>s) 15 { 16 f... ...
分类:其他好文   时间:2017-07-19 14:46:09    阅读次数:106
Python的字典的items(), keys(), values()
Python的字典的items(), keys(), values()都返回一个list >>> dict = { 1 : 2, 'a' : 'b', 'hello' : 'world' } >>> dict.values() ['b', 2, 'world'] >>> dict ...
分类:编程语言   时间:2017-07-19 14:25:27    阅读次数:143
demo3_list,dict
嵌套: 字典: ...
分类:其他好文   时间:2017-07-19 14:12:06    阅读次数:107
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!