浏览器网站免费进入厦门谷歌seo公司有哪些

当前位置: 首页 > news >正文

浏览器网站免费进入,厦门谷歌seo公司有哪些,wordpress上传文件夹,专业商城网站搭建价格背景需求#xff1a; 2023年第一学期#xff08;2023年9-2024年1月#xff09;#xff0c;我又被安排为“机动班”#xff0c;根据新学期的校历#xff0c;手动推算本学期的机动班的带班表 排版原则 1、班级数量#xff1a;共有6个班级#xff0c;循环滚动 2、每周次…背景需求 2023年第一学期2023年9-2024年1月我又被安排为“机动班”根据新学期的校历手动推算本学期的机动班的带班表 排版原则 1、班级数量共有6个班级循环滚动 2、每周次数4个半天周三不带班 3、跳过节日为了让每个班能平均轮到我预设了跳过节日的需求 代码展示 列表数量空格都是手动死算的。

https://www.cnblogs.com/gradyblog/p/16457279.html

from contextlib import nullcontext import datetime import sys import random from tkinter import dnd from openpyxl import load_workbook import xlrd import xlwt import time import datetime20230901校历七天 有日期星期 跳过周六周日和节日——上下学期都测过start2023-08-28 end2024-01-21 begin4 last2 weeksday21 title2023年上学期校历4天排班表跳过假日print(————第1步生成年月日列表前后有空日————)def date_generate(start_date, end_date):# print(fHi, {start_date}, {end_date})start_dt datetime.datetime.strptime(start_date, %Y-%m-%d)end_dt datetime.datetime.strptime(end_date, %Y-%m-%d)next_dt start_dtdate_list [] while next_dt end_dt:# next_dt_str next_dt.strftime(%Y-%m-%d)# next_dt_str next_dt.strftime(%m/%d)# next_dt_str next_dt.strftime(%m/%d)next_dt_str next_dt.strftime(%#m/%#d)# print(next_dt_str)date_list.append(next_dt_str)next_dt next_dt datetime.timedelta(days1) print(date_list)#生成全部需要的列表 [2023-09-01, 2023-09-02, 2023-09-03, 2023-09-04, 2023-09-05, 2023-09-06, 2023-09-07, 2023-09-08, 2023-09-09, 2023-09-10, 2023-09-11, 2023-09-12, 2023-09-13, 2023-09-14, 2023-09-15, 2023-09-16, 2023-09-17, 2023-09-18, 2023-09-19, 2023-09-20, 2023-09-21, 2023-09-22, 2023-09-23, 2023-09-24, 2023-09-25, 2023-09-26, 2023-09-27, 2023-09-28, 2023-09-29, 2023-09-30, 2023-10-01, 2023-10-02, 2023-10-03, 2023-10-04, 2023-10-05, 2023-10-06, 2023-10-07, 2023-10-08, 2023-10-09, 2023-10-10, 2023-10-11, 2023-10-12, 2023-10-13, 2023-10-14, 2023-10-15, 2023-10-16, 2023-10-17, 2023-10-18, 2023-10-19, 2023-10-20, 2023-10-21, 2023-10-22, 2023-10-23, 2023-10-24, 2023-10-25, 2023-10-26, 2023-10-27, 2023-10-28, 2023-10-29, 2023-10-30, 2023-10-31, 2023-11-01, 2023-11-02, 2023-11-03, 2023-11-04, 2023-11-05, 2023-11-06, 2023-11-07, 2023-11-08, 2023-11-09, 2023-11-10, 2023-11-11, 2023-11-12, 2023-11-13, 2023-11-14, 2023-11-15, 2023-11-16, 2023-11-17, 2023-11-18, 2023-11-19, 2023-11-20, 2023-11-21, 2023-11-22, 2023-11-23, 2023-11-24, 2023-11-25, 2023-11-26, 2023-11-27, 2023-11-28, 2023-11-29, 2023-11-30, 2023-12-01, 2023-12-02, 2023-12-03, 2023-12-04, 2023-12-05, 2023-12-06, 2023-12-07, 2023-12-08, 2023-12-09, 2023-12-10, 2023-12-11, 2023-12-12, 2023-12-13, 2023-12-14, 2023-12-15, 2023-12-16, 2023-12-17, 2023-12-18, 2023-12-19, 2023-12-20, 2023-12-21, 2023-12-22, 2023-12-23, 2023-12-24, 2023-12-25, 2023-12-26, 2023-12-27, 2023-12-28, 2023-12-29, 2023-12-30, 2023-12-31, 2023-01-01, 2023-01-02, 2023-01-03, 2023-01-04, 2023-01-05, 2023-01-06, 2023-01-07, 2023-01-08, 2023-01-09, 2023-01-10, 2023-01-11, 2023-01-12, 2023-01-13, 2023-01-14, 2023-01-15, 2023-01-16, 2023-01-17, , , , , , , ]print(————第2步第儿行的星期把星期补在日期旁边————)weeks2[]weeks [(一),(二),(三),(四),(五),(六),(日),] # 把星期(一)(二)做成很长很长的列表,便于取值for j in range(0,weeksday):for k in weeks:weeks2.append(k)print(weeks2)# [(一), (二), (三), (四), (五), (六), (日), (一), (二), (三), (四), (五), (六), (日), (一), (二), (三), (四), (五), (六), (日), (一), (二), (三), ( # 四), (五), (六), (日), (一), (二), (三), (四), (五), (六), (日), (一), (二), (三), (四),date_week[] # 计算共有几天d1 datetime.date(int(start.split(-)[0]), int(start.split(-)[1]), int(start.split(-)[2]))d2 datetime.date(int(end.split(-)[0]), int(end.split(-)[1]), int(end.split(-)[2]))time(d2 - d1).days1 # 要生成1351个日期print(time) # 先在date_week最前面加4个空值然后加上日期和星期合并# for x in range(begin): # 日期开始前加几个空值替代8月29日8月30日8月31日# b# date_week.append(b)# 第1-21周的日期和星期合并for s in range(0,time): # 一共21周*7-头空3天-尾空5天139天cdate_list[s]weeks2[s] # 日期和星期合并 日期从索引0开始取9月1日、星期从索引3开始取周四date_week.append©print(date_week) # 最后在date_week的后面加5个kong # for x in range(last): # 日期结束后加几个空值以免重新开始选取d# b# date_week.append(b)# print(date_week) # [,,,09/01(四), 09/02(五), 09/03(六), 09/04(日), 09/05(一), 09/06(二), 09/07(三), 09/08(四), 09/09(五), 09/10(六), 09/11(日), 09/12(一), 09/13(二), 09/14(三), 09/15(四), 09/16(五), 09/17(六), 09/18(日), 09/19(一), 09/20(二), 09/21(三), 09/22(四), 09/23(五), 09/24(六), 09/25(日), 09/26(一), 09/27(二), 09/28(三), 09/29(四), 09/30(五), 1001(六), 1002(日), 1003(一), 1004(二), 1005(三), 1006(四), 1007(五), 1008(六), 1009(日), 1010(一), 1011(二), 1012(三), 1013(四), 1014(五), 1015(六), 1016(日), 1017(一), 1018(二), 1019(三), 1020(四), 1021(五), 1022(六), 1023(日), 1024(一), 1025(二), 1026(三), 1027(四), 1028(五), 1029(六), 1030(日), 1031(一), 1101(二), 1102(三), 1103(四), 1104(五), 1105(六), 1106(日), 1107(一), 1108(二), 1109(三), 1110(四), 1111(五), 1112(六), 1113(日), 1114(一), 1115(二), 1116(三), 1117(四), 1118(五), 1119(六), 1120(日), 1121(一), 1122(二), 1123(三), 1124(四), 1125(五), 1126(六), 1127(日), 1128(一), 1129(二), 1130(三), 1201(四), 1202(五), 1203(六), 1204(日), 1205(一), 1206(二), 1207(三), 1208(四), 1209(五), 1210(六), 1211(日), 1212(一), 1213(二), 1214(三), 1215(四), 1216(五), 1217(六), 1218(日), 1219(一), 1220(二), 1221(三), 1222(四), 1223(五), 1224(六), 1225(日), 1226(一), 1227(二), 1228(三), 1229( # 四), 1230(五), 1231(六), 01/01(日), 01/02(一), 01/03(二), 01/04(三), 01/05(四), 01/06(五), 01/07(六), 01/08(日), 01/09(一), 01/10(二), 01/11(三), 01/12(四), 01/13( # 五), 01/14(六), 01/15(日), 01/16(一), 01/17(二), ]print(—-以上完成了日期和星期的拼接—–)print(———–第3步把所有的空格和日期都做在一起跳过节日的日期替代为节日名字 ——–)list_date[]# 取空列表# for p in range(0,1): #共1-2周 第1周索引取值0-7第2周索引 7-14依次类推

for kk in date_week[p*7:p*75]: # p*7 周一位置上的数字 p*75 周五位置上的数字

list_date.append(kk)# for p in range(1,2): #共1-2周 第1周索引取值0-7第2周索引 7-14依次类推

for kk in date_week[p*7:p*75]: # p*7 周一位置上的数字 p*75 周五位置上的数字

list_date.append(kk)# for p in range(2,3): #共3周 第1周索引取值0-7第2周索引 7-14依次类推

for kk in date_week[p*71:p*75]: # p*71 周二位置上的数字 p*75 周五位置上的数字

list_date.append(kk)# for p in range(3,5): #共4周 第1周索引取值0-7第2周索引 7-14依次类推

for kk in date_week[p*7:p*75]: # p*7 周一位置上的数字 p*75 周五位置上的数字

list_date.append(kk)# for p in range(0,3):

b国庆节 #

list_date.append(b)# for p in range(5,6): #6周2天把周六周日两天放到周四周五位置上

for kk in date_week[p*75:p*77]: # p*75周六位置上的数字 p*77 周日位置上的数字7实际显示的只有6的那个数

list_date.append(kk)# for p in range(6,17): #周都是5天

for kk in date_week[p*7:p*75]:

list_date.append(kk)# for p in range(17,18): #周前4天有5没有

for kk in date_week[p*7:p*74]: # p*7 周一位置上的数字 p*74 周四位置上的数字

list_date.append(kk)# for p in range(0,1):

b元旦节 #

list_date.append(b)# for p in range(18,21): #周都是5天

for kk in date_week[p*7:p*75]:

list_date.append(kk)

print(list_date)

# [, , , 91(四), 92(五), 95(一), 96(二), 97(三), 98(四), 99(五), 中秋节, 913(二), 914(三), 915(四), 916(五), 919(一),

# 920(二), 921(三), 922(四), 923(五), 926(一), 927(二), 928(三), 929(四), 930(五), 国庆节, 国庆节, 国庆节, 108(六), 109(日),

# 1010(一), 1011(二), 1012(三), 1013(四), 1014(五), 1017(一), 1018(二), 1019(三), 1020(四), 1021(五), 1024(一), 1025(二),

# 1026(三), 1027(四), 1028(五), 1031(一), 111(二), 112(三), 113(四), 114(五), 117(一), 118(二), 119(三), 1110(四), 1111(五),

# 1114(一), 1115(二), 1116(三), 1117(四), 1118(五), 1121(一), 1122(二), 1123(三), 1124(四), 1125(五), 1128(一), 1129(二), 1130(三), 121(四), 122(五), 125(一), 126(二), 127(三), 128(四), 129(五), 1212(一), 1213(二), 1214(三), 1215(四), 1216(五), 1219(一), 1220(二

# ), 1221(三), 1222(四), 1223(五), 1226(一), 1227(二), 1228(三), 1229(四), 端午节, 12(一), 13(二), 14(三), 15(四), 16(五),

# 19(一), 110(二), 111(三), 112(四), 113(五), 116(一), 117(二), , , ]# 在list_date五个五个取值 list_d[]for k in range(0,weeksday):list_d.append(date_week[k*7:k*77]) print(list_d)for opq in list_d:print(opq)# [, , , 91(四), 92(五)]# [95(一), 96(二), 97(三), 98(四), 99(五)]# [中秋节, 913(二), 914(三), 915(四), 916(五)]# [919(一), 920(二), 921(三), 922(四), 923(五)]# [926(一), 927(二), 928(三), 929(四), 930(五)]# [国庆节, 国庆节, 国庆节, 108(六), 109(日)]# [1010(一), 1011(二), 1012(三), 1013(四), 1014(五)]# [1017(一), 1018(二), 1019(三), 1020(四), 1021(五)]# [1024(一), 1025(二), 1026(三), 1027(四), 1028(五)]# [1031(一), 111(二), 112(三), 113(四), 114(五)]# [117(一), 118(二), 119(三), 1110(四), 1111(五)]# [1114(一), 1115(二), 1116(三), 1117(四), 1118(五)]# [1121(一), 1122(二), 1123(三), 1124(四), 1125(五)]# [1128(一), 1129(二), 1130(三), 121(四), 122(五)]# [125(一), 126(二), 127(三), 128(四), 129(五)]# [1212(一), 1213(二), 1214(三), 1215(四), 1216(五)]# [1219(一), 1220(二), 1221(三), 1222(四), 1223(五)]# [1226(一), 1227(二), 1228(三), 1229(四), 端午节]# [12(一), 13(二), 14(三), 15(四), 16(五)]# [19(一), 110(二), 111(三), 112(四), 113(五)]# [116(一), 117(二), , , ]print(———–第1步把每周排班5天做成21周的日期——–)# listsingle[ 01小3二静,02中1一清,03中3总蕾,04中4总琳,05大1总超]# 基本的一周排班# listsingle[ 托2(一瞿),小3(二超),中4(总顾),大1(总陆),大3(总蕾),大4(总琳)]# 基本的一周排班listsingle[01,02,03,04,05,06]list[]for x in range(21): #大约有21周for y in listsingle: # 提取基本一周排班里面的每一个值# print(y)list.append(y) # 把每个班级添加到list列表里顺序为“小3二,中1一,中3总,中4总,大1总” 并且重复提取21次。print(list) # 不缩进打印出来只有一份105个元素的列表#[小3二,中1一,中3总,中4总,大1总,小3二,中1一,中3总,中4总,大1总]print(———–第2步只抽取每周四个——–)list2[]# 取空列表# 第1周# 第1周ufor p in range(0,1): #for u in range(0,begin):b # 空5天list2.append(b)for kk in list[p:p1]: # 0:1list2.append(kk)for u in range(0,2):b # 空5天list2.append(b) # 第2-4周for p in range(0,3): #for kk in list[p*41:p*43]: # 4:6list2.append(kk)b # 空1天 取4天list2.append(b)for kk in list[p*43:p*45]: # 6:7list2.append(kk)for u in range(0,2):b # 空5天list2.append(b) # 第5周for p in range(3,4): #for kk in list[p*41:p*43]: # 11:15 list2.append(kk)b # 空1天list2.append(b)for kk in list[p*43:p*44]: # 11:15 list2.append(kk)b中秋节 # 空3天list2.append(b)for z in range(7):b国庆节 # 空3天list2.append(b)for p in range(3,4): #for kk in list[p*44:p*46]: # 15:17list2.append(kk)# 第3周2次for p in range(4,15): #for kk in list[p*42:p*44]: # 11:15 15:19list2.append(kk)b # 空3天list2.append(b)for kk in list[p*44:p*46]: # 11:15 15:19list2.append(kk)for u in range(0,2):b # 空5天list2.append(b) for p in range(15,16): # for kk in list[p*42:p*44]: # 11:15 15:19list2.append(kk)b # 空3天list2.append(b)for kk in list[p*44:p*46]: # 11:15 15:19list2.append(kk)for p in range(3): b元旦节 # 空3天list2.append(b)for p in range(16,17): # for kk in list[p*42:p*43]: # 11:15 15:19list2.append(kk)b # 空3天list2.append(b) for kk in list[p*43:p*45]: # 11:15 15:19list2.append(kk)for u in range(0,2):b # 空5天list2.append(b) print(list2) # 最后一周for p in range(17,19): #for kk in list[p*41:p*43]: # 4:6list2.append(kk)b # 空1天 取4天list2.append(b)for kk in list[p*43:p*45]: # 6:7list2.append(kk)for u in range(0,2):b # 空5天list2.append(b) # for # 在list_date五个五个取值 list3[]for k in range(0,21):list3.append(list2[k*7:k*77]) # print(list)for opq in list3:print(opq)print(———–第3步保存到excle——–)# 以下是xls保存arrlan len(list3)arrlan2 len(list_d)# 日期抽取5天一组workbook xlwt.Workbook()# 新建xls工作簿sheet workbook.add_sheet(Sheet)# 新建xls工作簿的工作表的名字是sheet# 第0列 写入“第1周、第2周、第3周……第21周 dates[]for i in range(1,weeksday1):n第{}周.format(i) # 用遍历方法获得“第1周、第2周、第21周”字样dates.append(n) # 添加到列表 print(dates) # print(date)row1 # A2开始for d in range(0, len(dates)):sheet.write(row, 0, dates[d]) # 这里enumerate不能用,因为只有一列,所以就用row 3 # 1逐行写入2中间空一行3中间空2行row2 # A3开始 再写一次第X周备注用for dd in range(0, len(dates)):sheet.write(row, 0, dates[dd]) # 这里enumerate不能用,因为只有一列,所以就用row 3 # 1逐行写入2中间空一行3中间空2行# row3 # A4开始 再写一次第X周备注用# for ddd in range(0, len(dates)):# sheet.write(row, 0, dates[ddd]) # 这里enumerate不能用,因为只有一列,所以就用# row 4 # 1逐行写入2中间空一行3中间空2行# 第0行 写入 星期一 星期二,星期三,星期四,星期五 星期六,星期日#weeks [周次,星期一,星期二,星期三,星期四,星期五,星期六,星期日]week len(weeks) col0 # A1写入for d in range(0, len(weeks)):sheet.write(0,col,weeks[d]) # 因为只有一行,所以就用有两种写法enumerate和这种col 1 # 1逐列写入2中间空一列3中间空2列2# B2 写入 7天日期月日row 1for i in range(arrlan2):for col,item in enumerate(list_d[i],1): # 提取7个一组里面的前5个sheet.write(row,col,item) row 3# B3 写入 5个5个的班级中间空1个row 2for i in range(arrlan):for col,item in enumerate(list3[i],1):sheet.write(row,col,item) row 3try:workbook.save(rD:\test{}.xls.format(title)) # 新建保存 只能xlsprint(计划生成成功)except e:print(失败…)print(e)# Press the green button in the gutter to run the script.

定义起始日期和结束日期

if name main:start_date {}.format(str(start))end_date {}.format(str(end))date_generate(start_date, end_date) 效果显示 把班级贴进去 存在问题 也就是我从第4周开始进班如果从第4周开始分布“01,02,03”6个班级列表的选择内容又要手动重新一个个调整了好难o(╥﹏╥)o