随笔分类 -  Python内置函数详解

详解Python的内置函数,使用的是3.5版本
摘要:引 言 国庆期间下定决心打算学习Python,于是下载安装了开发环境。然后问题就来了,怎么开始呢?纠结一番,还是从官方帮助文档开始吧。可是全是英文啊,英语渣怎么破?那就边翻译边看边实践着做吧(顺便吐槽下百度翻译,同样的语句百度翻译出来的结果和谷歌翻译出来的结果差的不是一丢丢)。鉴于以往学习语言的经历 阅读全文
posted @ 2016-12-07 14:10 十月狐狸 阅读(13797) 评论(20) 推荐(20) 编辑
摘要:英文文档: __import__(name, globals=None, locals=None, fromlist=(), level=0) This function is invoked by the import statement. It can be replaced (by impor 阅读全文
posted @ 2016-12-04 21:19 十月狐狸 阅读(10420) 评论(0) 推荐(0) 编辑
摘要:英文文档: zip(*iterables) Make an iterator that aggregates elements from each of the iterables. Returns an iterator of tuples, where the i-th tuple contai 阅读全文
posted @ 2016-12-04 13:25 十月狐狸 阅读(1068) 评论(0) 推荐(0) 编辑
摘要:英文文档: 说明 1. 当函数不接收参数时,其功能和locals函数一样,返回当前作用域内的局部变量。 2. 当函数接收一个参数时,参数可以是模块、类、类实例,或者定义了__dict__属性的对象。 阅读全文
posted @ 2016-12-03 23:49 十月狐狸 阅读(5559) 评论(0) 推荐(1) 编辑
摘要:英文文档: class type(object) class type(name, bases, dict) With one argument, return the type of an object. The return value is a type object and generall 阅读全文
posted @ 2016-12-03 23:22 十月狐狸 阅读(3616) 评论(0) 推荐(1) 编辑
摘要:英文文档: The constructor builds a tuple whose items are the same and in the same order as iterable‘s items. iterable may be either a sequence, a containe 阅读全文
posted @ 2016-12-03 17:19 十月狐狸 阅读(2419) 评论(0) 推荐(0) 编辑
摘要:英文文档: 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 阅读全文
posted @ 2016-12-01 23:44 十月狐狸 阅读(2632) 评论(0) 推荐(1) 编辑
摘要:英文文档: sum(iterable[, start]) Sums start and the items of an iterable from left to right and returns the total. start defaults to 0. The iterable‘s ite 阅读全文
posted @ 2016-11-17 08:59 十月狐狸 阅读(2393) 评论(0) 推荐(0) 编辑
摘要:英文文档: class str(object='') class str(object=b'', encoding='utf-8', errors='strict') Return a string version of object. If object is not provided, retu 阅读全文
posted @ 2016-11-17 08:53 十月狐狸 阅读(4753) 评论(0) 推荐(0) 编辑
摘要:英文文档: staticmethod(function) Return a static method for function. A static method does not receive an implicit first argument. The @staticmethod form 阅读全文
posted @ 2016-11-16 13:21 十月狐狸 阅读(1616) 评论(0) 推荐(0) 编辑
摘要:英文文档: sorted(iterable[, key][, reverse]) Return a new sorted list from the items in iterable. Has two optional arguments which must be specified as ke 阅读全文
posted @ 2016-11-16 12:53 十月狐狸 阅读(1003) 评论(0) 推荐(0) 编辑
摘要:英文文档: 说明: 1. 函数实际上是一个切片类的构造函数,返回一个切片对象。 2. 切片对象由3个属性start、stop、step组成,start和step默认值为None。切片对象主要用于对序列对象进行切片取对应元素。 3. 对应切片对象的3个属性start、stop、step,slice函数 阅读全文
posted @ 2016-11-15 11:33 十月狐狸 阅读(4327) 评论(0) 推荐(0) 编辑
摘要:英文文档: setattr(object, name, value) This is the counterpart of getattr(). The arguments are an object, a string and an arbitrary value. The string may 阅读全文
posted @ 2016-11-14 23:04 十月狐狸 阅读(1263) 评论(0) 推荐(0) 编辑
摘要:英文文档: 说明: 1. 传入一个可迭代对象,生成一个新的集合。 2. 不传入参数时,生成一个新的空集合。 3. 返回的集合是可以修改的。 阅读全文
posted @ 2016-11-14 22:52 十月狐狸 阅读(1205) 评论(0) 推荐(0) 编辑
摘要:英文文档: The behavior of round() for floats can be surprising: for example, round(2.675, 2) gives 2.67 instead of the expected 2.68. This is not a bug: i 阅读全文
posted @ 2016-11-14 00:14 十月狐狸 阅读(1646) 评论(0) 推荐(0) 编辑
摘要:英文文档: 说明: 1. 函数功能是反转一个序列对象,将其元素从后向前颠倒构建成一个新的迭代器。 2. 如果参数不是一个序列对象,则其必须定义一个__reversed__方法。 阅读全文
posted @ 2016-11-14 00:13 十月狐狸 阅读(6180) 评论(0) 推荐(0) 编辑
摘要:英文文档: 2. repr函数的结果一般能通过eval()求值的方法获取到原对象。 3. 对于一般的类型,对其实例调用repr函数返回的是其所属的类型和被定义的模块,以及内存地址组成的字符串。 4. 如果要改变类型的repr函数显示信息,需要在类型中定义__repr__函数进行控制。 阅读全文
posted @ 2016-11-13 22:58 十月狐狸 阅读(954) 评论(0) 推荐(0) 编辑
摘要:英文文档: 说明: 3. 可以传入一个起始整数和一个结束整数来初始化一个range类型,生成的range类型包含起始整数(包含),和结束整数(不包含)之间的所有整数。 4. 传入了起始整数和结束整数,还可以同时传入一个步进值来初始化一个range类型,生成的range类型包含起始整数(包含),和结束 阅读全文
posted @ 2016-11-12 09:22 十月狐狸 阅读(2000) 评论(0) 推荐(0) 编辑
摘要:英文文档: class property(fget=None, fset=None, fdel=None, doc=None) Return a property attribute. fget is a function for getting an attribute value. fset i 阅读全文
posted @ 2016-11-11 09:48 十月狐狸 阅读(1291) 评论(0) 推荐(0) 编辑
摘要:英文文档: print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False) Print objects to the text stream file, separated by sep and followed by end. se 阅读全文
posted @ 2016-11-10 22:40 十月狐狸 阅读(3380) 评论(0) 推荐(0) 编辑