代码拉取完成,页面将自动刷新
import os
ChineseNum = ['','一', '二', '三', '四', '五', '六', '七', '八', '九']
with open("D:\\GitbookLibrary\\SUMMARY.md","w",encoding="utf-8") as f:
f.write("# /\n")
f.write("* [Introduction/前言](README.md)\n\n")
count = 1
while count < 10 :
f.write("* [Chapter 0"+str(count)+" /第"+ChineseNum[count]+"章 ](0"+str(count)+"/README.md)\n")
index = 1
while index < 10 :
f.write(" * [Section 0"+str(count)+".0"+str(index)+" /](0"+str(count)+" /0"+str(index)+" .md)\n")
index += 1
count += 1
f.write("\n")
while count < 20 :
f.write("* [Chapter "+str(count)+" /第十"+ChineseNum[count-10]+"章 ]("+str(count)+"/README.md)\n")
index = 1
while index < 10 :
f.write(" * [Section "+str(count)+".0"+str(index)+" /]("+str(count)+" /0"+str(index)+" .md)\n")
index += 1
count += 1
f.write("\n")
while count <= 30 :
f.write("* [Chapter "+str(count)+" /第"+ChineseNum[count//10]+"十"+ChineseNum[count%10]+"章 ]("+str(count)+"/README.md)\n")
index = 1
while index < 10 :
f.write(" * [Section "+str(count)+".0"+str(index)+" /]("+str(count)+" /0"+str(index)+" .md)\n")
index += 1
count += 1
f.write("\n")
count = 999
index = 10
while index < 30 :
f.write(" * [Section "+str(count)+"."+str(index)+" /]("+str(count)+" /"+str(index)+" .md)\n")
index += 1
f.close()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。