摘要: 笔记-python-standard library-9.6 random 1. random source code:Lib/random.py 1.1. functions for integers random.randrange(stop) random.randrange(start, s 阅读全文
posted @ 2018-10-01 23:37 木林森__𣛧 阅读(155) 评论(0) 推荐(0)
摘要: 笔记-python-standard library-8.10 copy 1. copy source code:Lib/copy.py python中的赋值语句不复制对象,它创建了对象和目标之间的指向/绑定。 对于可变对象来说,有时需要一个复制体,而非引用,本模块提供了shallow copy和d 阅读全文
posted @ 2018-09-30 14:35 木林森__𣛧 阅读(138) 评论(0) 推荐(0)
摘要: 笔记-python-standard library-8.5.heapq 1. heapq-heap queue algorithm源码:Lib/heapq.pythis module provides an implementation of the heap queue algorithm.he 阅读全文
posted @ 2018-09-30 14:00 木林森__𣛧 阅读(151) 评论(0) 推荐(0)
摘要: 笔记-python-standard library-8.1 data types-datetime 1. Datatimes 本章节内容为日期和时间处理类和方法。 1.1. datetime-basic date and time types source code: Lib/datetime.p 阅读全文
posted @ 2018-09-30 12:40 木林森__𣛧 阅读(168) 评论(0) 推荐(0)
摘要: 笔记-python tutorial-9.classes 1. Classes 1.1. scopes and namespaces namespace: A namespace is a mapping from names to objects. 典型的命名空间有:built-in names; 阅读全文
posted @ 2018-09-28 13:06 木林森__𣛧 阅读(201) 评论(0) 推荐(0)
摘要: 笔记-python-tutorial-8.errors and exceptions 1. errors and exceptions 1.1. syntax errors >>> while True print('Hello world') File "<stdin>", line 1 whil 阅读全文
posted @ 2018-09-28 12:50 木林森__𣛧 阅读(109) 评论(0) 推荐(0)
摘要: 笔记-python-变量作用域 1. python变量作用域和引用范围 1.1. 变量作用域 一般而言程序的变量并不是任何对象或在任何位置都可以访问的,访问权限决定于这个变量是在哪里赋值的。 变量的作用域决定了在哪一部分程序可以访问哪个变量。 Python的作用域一共有4种,分别是: L (Loca 阅读全文
posted @ 2018-09-25 11:02 木林森__𣛧 阅读(168) 评论(0) 推荐(0)
摘要: 笔记-python-lib-内置函数 注:文档来源为Python3.6.4官方文档 1. built-in functions 如果 source 为整数,则返回一个长度为 source 的初始化数组; 如果 source 为字符串,则按照指定的 encoding 将字符串转换为字节序列; 如果 s 阅读全文
posted @ 2018-09-24 20:41 木林森__𣛧 阅读(205) 评论(0) 推荐(0)
摘要: 笔记-python-tutorial-5.data structure 1. data structure 1.1. list operation remove the first item from the list whose value is x.if x is not exist retur 阅读全文
posted @ 2018-09-24 20:27 木林森__𣛧 阅读(154) 评论(0) 推荐(0)
摘要: 笔记-python-tutorial-4.controlflow( and function) 1. 函数 1.1. 定义函数 def name(x): “””函数的第一行语句可以是可选的字符串文本,即函数的文档字符串,或docstring””” if x>= 0: return x 空函数 def 阅读全文
posted @ 2018-09-24 13:58 木林森__𣛧 阅读(147) 评论(0) 推荐(0)