一、匿名函数 语法: 应用场合 作为函数的实参 作为python内置函数的参数。 二、文件 打开文件: 使用open()函数。 | 访问模式 | 说明 | | | | | r | 以只读方式打开文件。文件的指针将会放在文件的开头。这是默认模式。 | | w | 打开一个文件只用于写入。如果该文件已存 ...
分类:
编程语言 时间:
2017-12-31 21:12:53
阅读次数:
147
常见的Python内置函数详解函数列表进制转换函数函数名称及参数功能用例bin(x)将数值x转化为二进制>>> x=10 >>> bin(10) 10hex(x)将数值x转化为十六进制>>> x=10 >>> hex(10) '0xa'oct(x)将数值X转化为八进制>>> x=10 >
分类:
编程语言 时间:
2017-12-30 19:05:43
阅读次数:
213
英文文档: setattr(object, name, value) This is the counterpart of getattr(). The arguments are an object, a string and an arbitrary value. The string may ...
分类:
编程语言 时间:
2017-12-29 16:57:59
阅读次数:
144
英文文档: callable(object) Return True if the object argument appears callable, False if not. If this returns true, it is still possible that a call fails ...
分类:
编程语言 时间:
2017-12-29 16:56:11
阅读次数:
179
英文文档: 2. 函数第三个参数default为可选参数,如果object中含义name属性,则返回name属性的值,如果没有name属性,则返回default值,如果default未传入值,则报错。 ...
分类:
编程语言 时间:
2017-12-29 16:54:47
阅读次数:
130
英文文档: any(iterable) Return True if any element of the iterable is true. If the iterable is empty, return False. Equivalent to: 判断可迭代对象的元素是否有 True值的元素 ...
分类:
编程语言 时间:
2017-12-29 16:21:12
阅读次数:
175
英文文档: class objectReturn a new featureless object. object is a base for all classes. It has the methods that are common to all instances of Python cla ...
分类:
编程语言 时间:
2017-12-29 16:19:40
阅读次数:
143
英文文档: all(iterable) Return True if all elements of the iterable are true (or if the iterable is empty). Equivalent to: 判断可迭代对象的每个元素都是 True 值 说明: 1. 接受 ...
分类:
编程语言 时间:
2017-12-29 16:19:33
阅读次数:
138
英文文档: super([type[, object-or-type]]) Return a proxy object that delegates method calls to a parent or sibling class of type. This is useful for acces ...
分类:
编程语言 时间:
2017-12-29 16:17:37
阅读次数:
168