countdoc1 textExample.get( 1.0 , end ) # 获取多少题
countdoc2 textExample2.get( 1.0 , end ) # 形成多少题库文档
countdoc3 textExample3.get( 1.0 , end )
countdoc1 str(countdoc1).replace( n , )
countdoc2 str(countdoc2).replace( n , )
countdoc3 str(countdoc3).replace( n , )
filelist upload_file()
r readfile(filelist)
folderpath ./生成的题库
docName countdoc3
folderpath os.path.join(folderpath, docName)
makefolder(folderpath) # 创建文件夹
n int(countdoc2)
while True:
if m n:
break
else:
filename docName _ str(m)
filapathName os.path.join(folderpath, filename)
print(f {filename} 生成成功 )
wordDoc(r,countdoc3,filapathName,countdoc1)
def thread_it(func):
将函数打包进线程
# 创建
t threading.Thread(target func)
# 守护 !!!
t.setDaemon(True)
# 启动
t.start()
# 阻塞--卡死界面
#输入文件
upload tk.frame(window)
upload.pack(padx 20,pady 20)
upload_entry tk.Entry(upload, width 40 )
upload_entry.pack(padx 50,pady 10)
import time
nowtime time.time()
nowtime1 int(time.time())
nowtime2 int(time.time()) 3000