摘要:
随机整数: 随机选择一个返回: 随机打乱次序: 阅读全文
posted @ 2019-08-28 18:42
aikell
阅读(187)
评论(0)
推荐(0)
摘要:
常用方法: time.time():获取当前时间戳 time.sleep():推迟线程指定的运行时间。单位为秒。 print(time.time())#当前时间的时间戳 print(time.strftime('%Y-%m-%d %H:%M:%S'))#格式化当前时间 print(time.localtime())#结构化时间 python中时间日期格式化符号: %y 两位数的年份... 阅读全文
posted @ 2019-08-28 18:02
aikell
阅读(187)
评论(0)
推荐(0)
摘要:
namedtuple:生成一个可以使用名字来访问的tuple from collections import namedtuple point = namedtuple('point',['x','y','z','r']) p = point(1,2,3,4) print(p.z) print(p.x) print(p.y) print(p.r) print(p) 打印: 3 1 2 4 poin 阅读全文
posted @ 2019-08-28 16:02
aikell
阅读(231)
评论(0)
推荐(0)

浙公网安备 33010602011771号