摘要:
import datetime'''datetime比time高级了不少,可以理解为datetime基于time进行了封装,提供了各位使用的函数,datetime模块的接口更直观,更容易调用模块中的类:datetime 同时有时间和日期timedelta 主要用于计算时间的跨度tzinfo 时区相关 阅读全文
摘要:
第一种 python -m install pip --upgrade pip 第二种 python -m pip install -u --force-reinstall pip 第三种 pip install --user -- upgrade pip 第四种 python -m pip ins 阅读全文
摘要:
import time'''UTC(世界协调时间):格林尼治天文时间,世界标准时间,在中国来说是UTC+8DST(夏令时):是一种节约能源而人为规定时间制度,在夏季调快1个小时时间的表示形式:1、时间戳以整型或浮点型表示时间的一个以秒为单位的时间间隔。这个时间间隔的基础值是从1970年1月1日领带开 阅读全文
摘要:
import osimport collectionsdef getAllDirQU(path): queue = collections.deque() #进队 queue.append(path) while len(queue) != 0: #出队数据 dirPath = queue.popl 阅读全文
摘要:
import osdef getAllDirDE(path): stack = [] stack.append(path) #处理栈,当栈为空的时候结束循环 while len(stack) != 0: #从栈里取出数据 #[] dirPath = stack.pop() #print(dirPat 阅读全文
摘要:
import osdef getAllDirRE(path, sp = ""): #得到当前目录下所有的文件 filesList = os.listdir(path) #处理每一个文件 sp += " " for fileName in filesList: #判断是否是路径(用绝对路径) file 阅读全文
摘要:
import collections#创建一个队列queue = collections.deque()print(queue)#进队(存数据)queue.append("A")print(queue)queue.append("B")print(queue)queue.append("C")pri 阅读全文
摘要:
#模拟栈结构stack = []#压栈(向栈里存数据)stack.append("A")print(stack)stack.append("B")print(stack)stack.append("C")print(stack)#出栈(在栈里取数据)res1 = stack.pop()print(" 阅读全文
摘要:
'''递归调用:一个函数,调用了自身,称为递归调用递归函数:一个会调用自身的函数称为递归函数凡是循环能干的事,递归都能干''''''方式:1、写出临界条件2、找这一次和上一次的关系3、假设当前函数已经能用,调用自身计算上一次的结果,再求出本次的结果'''#输入一个数(大于等于1),求1+2+3+…… 阅读全文