time模块 import time print(help(time)) time.time() #return current time in seconds since the Epoch as a float 时间戳:以秒的形式返回当前时间,从1970年算起 time.clock() #return CPU time since process start as a float 只计算CPU执行的时间 time.sleep() # delay for a number of second…
一.collections模块 1.其他数据类型 在内置数据类型(str.dict.list.tuple.set)的基础上,collections模块还提供了了几个额外的数据类型:Counter.deque.defaultdict.namedtuple和OrderedDict. 2.namedtuple(具名元组) ①.用具名元组表示一个点坐标 from collections import namedtuple Point = namedtuple('Point',['x','y']) p =…