摘要:
""" os 模块:是跟操作系统打交道的 sys 模块:是跟python解释器打交道的 """ import os DASE_DIR = os.path.dirname(__file__) #返回path 的目录 其实就是os.path.spilt(path)的第一个元素 MOVIE_DIR = os.path.join(DASE_DIR,"老师精品") #join 将多个路径组合后返回 ... 阅读全文
posted @ 2019-07-18 23:36
杨鑫Zz
阅读(105)
评论(0)
推荐(0)
摘要:
#随机模块 import random # # print(random.randint(1,6)) #随机提取一个 你给的整数范围内的数字然后打印 # print(random.random()) #随机取0-1 之间的小数 # print(random.choice([1,2,34,5,6,7,])) #随机抽取列表内数字 # res = [1,2,3,4,5,6,7,8,9,10,1... 阅读全文
posted @ 2019-07-18 19:33
杨鑫Zz
阅读(170)
评论(0)
推荐(0)
摘要:
""" 时间模块 import time 三种表现形式 1.时间戳 2.格式化时间(用来展示给人看的) 3. 结构化时间 """ # import time # print(time.time())#显示的是从1970:1月1日凌晨00:00到现在的时间 # #结果:1563446269.2257721 # print(time.strftime("%Y-%m-%d")... 阅读全文
posted @ 2019-07-18 19:06
杨鑫Zz
阅读(141)
评论(0)
推荐(0)
摘要:
"" collection 模块 首先 在学习这个模块之前我们还学习过其他的 整形 浮点型 字符串 列表 字典 元祖 集合 布尔值 而 collection模块也是其中之一 增加了解 具名元祖 想表示坐标点x为1 y 为2的坐标 """ # from collections import namedtuple # point = namedtuple("坐标",["x",... 阅读全文
posted @ 2019-07-18 18:15
杨鑫Zz
阅读(178)
评论(0)
推荐(0)

浙公网安备 33010602011771号