五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

jhpy錯(cuò)題集自動生成程序

2023-07-15 08:18 作者:感覺__站不如油管  | 我要投稿

暑期在某教育機(jī)構(gòu)兼職助教,由于要為每位學(xué)生整理每節(jié)課出門測的錯(cuò)題,工作量巨大,因此編寫了該程序,能偷懶一點(diǎn)是一點(diǎn)。mmd,以前哪有那么多事情,jhpy。


效果:在為試卷手動打標(biāo)后,運(yùn)行程序,生成每位學(xué)生每課的錯(cuò)題集,錯(cuò)題都會被加在同一個(gè)word,結(jié)構(gòu)如下

班級成績excel:


?務(wù)必把chumence.exe和設(shè)置路徑.xlsx放在同一個(gè)文件夾下:


?使用:


0.分割試卷,單個(gè)題用###


?不需要的內(nèi)容用!??!


小貓釣魚等1+n的題目用@@@與@@@@@?


1.點(diǎn)擊chumence.exe


2.選擇成績excel


3.選擇出門測試卷word


4.檢查、修改、關(guān)閉分割完的題目格式是否有問題,直接修改保存


5.等待程序運(yùn)行完


可能遇到的問題的解決辦法(測試下來一共就這幾種):


1.必須有微軟office,否則無法使用程序


2.word中,安全,宏設(shè)置,啟用所有宏;信任對VBA工程對象……,否則會跳出安全警告


3.文件名中帶有特殊字符,如?,無法生成文件夾


4.忘了,再補(bǔ)充


代碼如下,可打包成exe方便使用:


# -*- coding: utf-8 -*-

from openpyxl import load_workbook

from docx import Document

import docx

import tkinter as tk

from tkinter import filedialog

import numpy as np

import os

import docx

from docx.text.paragraph import Paragraph

from docx.image.image import Image

from docx.parts.image import ImagePart

from docx.oxml.shape import CT_Picture

import win32com.client as win32

from win32com.client import constants

import? win32com

import signal

import wmi

import datetime

import time



c = wmi.WMI()

for process in c.Win32_Process(name="WINWORD.EXE"):

? ? process.Terminate()


def mkdir(path):

? ? folder = os.path.exists(path)

? ? if not folder:? # 判斷是否存在文件夾如果不存在則創(chuàng)建為文件夾

? ? ? ? os.makedirs(path)? # makedirs 創(chuàng)建文件時(shí)如果路徑不存在會創(chuàng)建這個(gè)路徑


def sp(shuzu,cn,c,sn,s,date):

? ? sent = ""

? ? for temp in shuzu:

? ? ? ? if temp == "cn":

? ? ? ? ? ? sent = sent + str(cn)

? ? ? ? elif temp == "c":

? ? ? ? ? ? sent = sent + str(c)

? ? ? ? elif temp == "sn":

? ? ? ? ? ? sent = sent + str(sn)

? ? ? ? elif temp == "s":

? ? ? ? ? ? sent = sent + str(s)

? ? ? ? elif temp == "date":

? ? ? ? ? ? sent = sent + str(date)

? ? ? ? elif temp == "/":

? ? ? ? ? ? sent = sent + "/"

? ? ? ? else:

? ? ? ? ? ? print("請輸入規(guī)范的縮寫!")

? ? return sent





# 實(shí)例化

root = tk.Tk()

root.withdraw()


# 獲取文件夾路徑

print("————————————————請選擇出門測成績excel——————————————")

print("? ?")

print("? ?")

print("? ?")

#score_path = "C:/Users/y3420/Desktop/出門測錯(cuò)題集自動生成程序/江浦路23年07月03日地理張靖成績明細(xì).xlsx"

score_path = filedialog.askopenfilename()

print(score_path)

#score_path = 'C:/Users/y3420/Desktop/出門測/出門測成績匯總.xlsx'

print("————————————————請選擇出門測試卷word——————————————")

print("? ?")

print("? ?")

print("? ?")

#doc_path = "C:/Users/y3420/Desktop/出門測錯(cuò)題集自動生成程序/高一暑出門測01英語.docx"

doc_path = filedialog.askopenfilename()

print(doc_path)

#doc_path = 'C:/Users/y3420/Desktop/出門測/地理第一次.docx'

print("————————————————請選擇學(xué)員上級總文件夾——————————————")

print("? ?")

print("? ?")

print("? ?")

top_path = filedialog.askdirectory()

#top_path = "C:/Users/y3420/Desktop/出門測錯(cuò)題集自動生成程序/日月光test"

print(top_path)

#top_path = 'C:/Users/y3420/Desktop/日月光test/'

print("————————————————正在自動生成錯(cuò)題集——————————————")

print("? ?")

print("? ?")

print("? ?")

set_path = '設(shè)置路徑.xlsx'


#讀取設(shè)置的路徑

set = load_workbook(set_path)

sheets = set.worksheets

sheet1 = sheets[0]

i = 2

set_ctj_path = []

set_title = []

print(sheet1[11][1].value)

while sheet1[i][1].value is not None:

? ? set_ctj_path.append(sheet1[i][1].value)

? ? print(sheet1[i][1].value)

? ? i = i + 1

i = 2

while sheet1[i][2].value is not None:

? ? set_title.append(sheet1[i][2].value)

? ? print(sheet1[i][2].value)

? ? i = i + 1

i = 0

print("out1")


# 讀取出門測成績表

score = load_workbook(score_path)

doc = Document(doc_path)

sheets = score.worksheets

sheet1 = sheets[0]


#print(sheet1[6][2].value) #sheet1 [1][0]開始的



# 獲取總行數(shù)

max_row_num = sheet1.max_row

max_column_num = sheet1.max_column


# 獲取班級編號

row_list1 =? []

for i in range(1,max_row_num):

? ? for j in range(0,max_column_num):

? ? ? ? if sheet1[i][j].value == "班級編號":

? ? ? ? ? ? class_num = sheet1[i + 1][j].value

? ? ? ? if sheet1[i][j].value == "班級名稱":

? ? ? ? ? ? class_name = sheet1[i + 1][j].value

? ? ? ? if sheet1[i][j].value == "考試日期":

? ? ? ? ? ? date = sheet1[i + 1][j].value

? ? ? ? if sheet1[i][j].value == "錯(cuò)誤率":

? ? ? ? ? ? first_i = i + 1

? ? ? ? ? ? first_j = j - 1


with open("日志.txt","a+") as f: #追加寫入日志

? ? d = datetime.datetime.now()

? ? d.year

? ? d.month

? ? d.day

? ? d.hour

? ? d.minute

? ? f.write(str(d.year) + " " + str(d.month) + " " + str(d.day) + " " + str(d.hour) + " " + str(d.minute) + "\n")

? ? f.write(class_num + class_name + "\n")

? ? f.write(score_path + "\n")

? ? f.write(doc_path + "\n")

? ? f.write(top_path + "\n")


with open("錄入.txt","a+") as f: #追加寫入日志

? ? d = datetime.datetime.now()

? ? d.year

? ? d.month

? ? d.day

? ? d.hour

? ? d.minute

? ? f.write(str(d.year) + " " + str(d.month) + " " + str(d.day) + " " + str(d.hour) + " " + str(d.minute) + "\n")

? ? f.write(class_num + class_name + "\n")

? ? f.write(score_path + "\n")

? ? f.write(doc_path + "\n")

? ? f.write(top_path + "\n")


# 獲取正確答案

row_list2 =? []

for row in sheet1[6]:

? ? row_list2.append(row.value) # 從下標(biāo)3開始為正確答案


#出門測分run

num = 3

tnum = -1

flag = 0

index = np.zeros((100,4),dtype=int)

#[頭部序號,第一題序號,最后一題序號,是否加了頭部]

pin = 0

docum = Document()

indoc = Document()


#打標(biāo)記

line = 3

line0 = 0

line2 = []# !!!,@@@

line22 = []#0,3,4

for i in doc.paragraphs:

? ? if i.text == "###" or i.text == "@@@" or i.text == "@@@@@":

? ? ? ? line2.append(i.text)

? ? ? ? i.text = i.text + str(line)

? ? ? ? line22.append(line)

? ? ? ? line = line + 1

? ? if i.text == "!!!" or i.text == "?。?!":

? ? ? ? line2.append(i.text)

? ? ? ? i.text = i.text + str(line0)

? ? ? ? line22.append(line0)

? ? ? ? line0 = line0 - 1


temp_path = top_path + "/" + "temp.docx"

doc.save(top_path + "/" + "temp.docx")


runs_path = top_path + "/"


# 打開word應(yīng)用程序

word = win32com.client.DispatchEx('Word.Application')

# 是否可視化

word.Visible = 1

# 打開

print(temp_path)

doc = word.Documents.Open(temp_path)

# 光標(biāo)start的查找

# 賦值對象

search_range = doc.Content

# 查找內(nèi)容

st = 0

ed = 0

start = 0

now = 3



"""

? ??

start = 0


# 光標(biāo)end的查找? 同上

search_range = doc.Content

search_range.Find.Execute(FindText="!@#")

search_range.Select()

word.Selection.MoveLeft()

end = word.Selection.Start.numerator

print(end)


# 選取光標(biāo)start到光標(biāo)end的內(nèi)容

doc.Range(start, end).Select()

# 復(fù)制

word.Selection.Copy()

# 粘貼的目標(biāo)文件

doc_new = word.Documents.Open(runs_path + str(now) + '.docx')

# 粘貼

doc_new.Application.ActiveDocument.Range().Paste()

# 關(guān)閉兩個(gè)文件

doc_new.Close()

doc.Close()


"""

#chace = []#復(fù)制內(nèi)容

#chace2 = []#對應(yīng)的下標(biāo)


p = 0

runs_path = top_path + "/"

doc = word.Documents.Open(temp_path)

for g in range(0,len(line2)):

? ? i = line2[g]#i 是后一個(gè)

? ? if p == 0:

? ? ? ? start = 0

? ? ? ? # 光標(biāo)end的查找? 同上

? ? ? ? doc = word.Documents.Open(temp_path)

? ? ? ? search_range = doc.Content

? ? ? ? search_range.Find.Execute(FindText=(str(line2[g])+str(line22[g])))

? ? ? ? search_range.Select()

? ? ? ? word.Selection.MoveLeft()

? ? ? ? end = word.Selection.Start.numerator

? ? ? ? # 選取光標(biāo)start到光標(biāo)end的內(nèi)容

? ? ? ? doc.Range(start, end).Select()

? ? ? ? # 復(fù)制

? ? ? ? word.Selection.Copy()

? ? ? ? #chace.append(word.Selection.Copy())#

##

? ? ? ? if i == "###":

? ? ? ? ? ? way = runs_path + str(num) + '.docx'

? ? ? ? ? ? num = num + 1

? ? ? ? ? ? #chace2.append(num)#

? ? ? ? elif i == "!!!" or i == "!??!":

? ? ? ? ? ? way = runs_path + 'nouse.docx'

? ? ? ? elif i == "@@@" and flag == 0:? # 頭部

? ? ? ? ? ? way = runs_path + str(tnum) + '.docx'

? ? ? ? ? ? #chace2.append(tnum)#

? ? ? ? ? ? index[pin, 0] = tnum

? ? ? ? ? ? tnum = tnum - 1

? ? ? ? ? ? flag = flag + 1

? ? ? ? elif i == "@@@" and flag != 0:? # 第一題——

? ? ? ? ? ? if flag == 1:

? ? ? ? ? ? ? ? index[pin, 1] = num

? ? ? ? ? ? way = runs_path + str(num) + '.docx'

? ? ? ? ? ? #chace2.append(num)#

? ? ? ? ? ? num = num + 1

? ? ? ? ? ? flag = flag + 1

##

? ? ? ? # 粘貼的目標(biāo)文件

? ? ? ? print(way)

? ? ? ? print("0:"+str(line2[g])+str(line22[g]))

? ? ? ? docxx = Document()

? ? ? ? docxx.add_paragraph()

? ? ? ? docxx.save(way)

? ? ? ? doc_new = word.Documents.Open(way)

? ? ? ? # 粘貼

? ? ? ? doc_new.Application.ActiveDocument.Range().Paste()

? ? ? ? # 關(guān)閉兩個(gè)文件

? ? ? ? #doc_new.Close()#不關(guān)閉文檔

? ? ? ? doc.Close()

? ? ? ? p = 1

? ? else:

? ? ? ? doc = word.Documents.Open(temp_path)

? ? ? ? search_range = doc.Content

? ? ? ? j = line2[g-1]#j 是前一個(gè)

? ? ? ? search_range.Find.Execute(FindText=(j+str(line22[g-1])))

? ? ? ? # 選中查找到的內(nèi)容

? ? ? ? search_range.Select()

? ? ? ? # 光標(biāo)左移

? ? ? ? word.Selection.MoveRight()

? ? ? ? # 將光標(biāo)位置賦予start

? ? ? ? start = word.Selection.Start.numerator

? ? ? ? # 光標(biāo)end的查找? 同上

? ? ? ? search_range = doc.Content

? ? ? ? search_range.Find.Execute(FindText=(i+str(line22[g])))

? ? ? ? search_range.Select()

? ? ? ? word.Selection.MoveLeft()

? ? ? ? end = word.Selection.Start.numerator

? ? ? ? # 選取光標(biāo)start到光標(biāo)end的內(nèi)容

? ? ? ? doc.Range(start, end).Select()

? ? ? ? word.Selection.Copy()

? ? ? ? #chace.append(word.Selection.Copy())

? ? ? ? if i == "###":

? ? ? ? ? ? way = runs_path + str(num) + '.docx'

? ? ? ? ? ? #chace2.append(num)

? ? ? ? ? ? num = num + 1

? ? ? ? elif i == "!!!" or i == "?。。?#34;:

? ? ? ? ? ? way = runs_path + 'nouse.docx'

? ? ? ? elif i == "@@@" and flag == 0:? # 頭部

? ? ? ? ? ? way = runs_path + str(tnum) + '.docx'

? ? ? ? ? ? #chace2.append(tnum)

? ? ? ? ? ? index[pin, 0] = tnum

? ? ? ? ? ? tnum = tnum - 1

? ? ? ? ? ? flag = flag + 1

? ? ? ? elif i == "@@@" and flag != 0:? # 第一題——

? ? ? ? ? ? if flag == 1:

? ? ? ? ? ? ? ? index[pin, 1] = num

? ? ? ? ? ? way = runs_path + str(num) + '.docx'

? ? ? ? ? ? #chace2.append(num)

? ? ? ? ? ? num = num + 1

? ? ? ? ? ? flag = flag + 1

? ? ? ? elif i == "@@@@@":#最后一題

? ? ? ? ? ? if index[pin,1] == 0:

? ? ? ? ? ? ? ? index[pin,1] = num

? ? ? ? ? ? index[pin,2] = num

? ? ? ? ? ? if pin <=99:

? ? ? ? ? ? ? ? pin = pin + 1

? ? ? ? ? ? else:

? ? ? ? ? ? ? ? print("超出最大限度")

? ? ? ? ? ? flag = 0

? ? ? ? ? ? way = runs_path + str(num) + '.docx'

? ? ? ? ? ? #chace2.append(num)

? ? ? ? ? ? #indoc.save(runs_path + str(num) + '.docx')

? ? ? ? ? ? indoc = Document()

? ? ? ? ? ? num = num + 1

? ? ? ? # 粘貼的目標(biāo)文件

? ? ? ? print(way)

? ? ? ? print(j+str(line22[g-1])+" : "+i+str(line22[g]))

? ? ? ? docxx = Document()

? ? ? ? docxx.add_paragraph()

? ? ? ? docxx.save(way)

? ? ? ? doc_new = word.Documents.Open(way)

? ? ? ? # 粘貼

? ? ? ? doc_new.Application.ActiveDocument.Range().Paste()

? ? ? ? # 關(guān)閉兩個(gè)文件

? ? ? ? #doc_new.Close()#不關(guān)閉文檔

? ? ? ? doc.Close()

print(line2)

print(line22)

print("請檢查分割出的word格式是否正確,調(diào)正完成后請隨便輸入點(diǎn)東西,回車")

input()


app =win32com.client.Dispatch('Word.Application')

# 挨個(gè)創(chuàng)建錯(cuò)題word

top_path= top_path + "/"


if not os.path.exists(top_path + "tttttt.docx"):

? ? indoc = docx.Document()

? ? indoc.save(top_path + "tttttt.docx")

else:

? ? docxxx = Document()

? ? docxxx.add_paragraph()

? ? docxxx.save(top_path + "tttttt.docx")


for i in range(first_i, max_row_num+1):#讀取同學(xué)的答案

? ? c = wmi.WMI()

? ? for process in c.Win32_Process(name="WINWORD.EXE"):

? ? ? ? process.Terminate()

? ? app = win32com.client.Dispatch('Word.Application')

? ? glag = 0

? ? flag = 0

? ? fish = 0

? ? index[:,3] = 0

? ? row_list3 = []

? ? for row in sheet1[i]:

? ? ? ? row_list3.append(row.value)

? ? sn = row_list3[first_j]

? ? s = row_list3[first_j + 1]

? ? cn = class_num

? ? c = class_name

? ? if s != "NoneNone":

? ? ? ? ctj_path = top_path + sp(set_ctj_path,cn,c,sn,s,date) #錯(cuò)題集路徑

? ? ? ? title = sp(set_title,cn,c,sn,s,date)? # word名字? 班級號+班級名稱+考試日期

? ? ? ? #ctj_path = top_path + str(sn) + str(s) + '/' + str(c) + '/' + str(title) + '.docx' #如果文件夾里沒有班級編號,只能依據(jù)班級名稱查找

? ? ? ? for j in range(3, len(row_list2)):#檢查每一題的對錯(cuò)

? ? ? ? ? ? #a = time.time()##############

? ? ? ? ? ? if row_list2[j] != row_list3[j]:#錯(cuò)題

? ? ? ? ? ? ? ? mkdir(ctj_path)? # 如果路徑不存在,則生成

? ? ? ? ? ? ? ? if not os.path.exists(ctj_path + "/" + title + ".docx"):

? ? ? ? ? ? ? ? ? ? indoc = docx.Document()

? ? ? ? ? ? ? ? ? ? indoc.save(ctj_path + "/" + title + ".docx")

? ? ? ? ? ? ? ? if pin >= 1:#如果有小貓釣魚

? ? ? ? ? ? ? ? ? ? for k in range(0,pin):

? ? ? ? ? ? ? ? ? ? ? ? if j >= index[k,1] and j <= index[k,2]:#查詢是否為小貓釣魚

? ? ? ? ? ? ? ? ? ? ? ? ? ? fish = 1

? ? ? ? ? ? ? ? ? ? ? ? ? ? break

? ? ? ? ? ? ? ? ? ? ? ? else:

? ? ? ? ? ? ? ? ? ? ? ? ? ? fish = 0

? ? ? ? ? ? ? ? ? ? if fish == 1:

? ? ? ? ? ? ? ? ? ? ? ? if index[k,3] == 0:#如果為第一次出現(xiàn),則同時(shí)選項(xiàng)與題目? win32com.client.Dispatch('Word.Application').Documents.Open

? ? ? ? ? ? ? ? ? ? ? ? ? ? app = win32com.client.Dispatch('Word.Application')

? ? ? ? ? ? ? ? ? ? ? ? ? ? file_mode = runs_path + str(index[k,0]) + '.docx'

? ? ? ? ? ? ? ? ? ? ? ? ? ? doc = app.Documents.Open(file_mode)

? ? ? ? ? ? ? ? ? ? ? ? ? ? doc.Content.Copy()

? ? ? ? ? ? ? ? ? ? ? ? ? ? doc.Close()

? ? ? ? ? ? ? ? ? ? ? ? ? ? word = win32com.client.DispatchEx('Word.Application')

? ? ? ? ? ? ? ? ? ? ? ? ? ? doc1 = word.Documents.Open(top_path + "tttttt.docx")

? ? ? ? ? ? ? ? ? ? ? ? ? ? s = word.Selection

? ? ? ? ? ? ? ? ? ? ? ? ? ? s.MoveRight(1,doc1.Content.End)

? ? ? ? ? ? ? ? ? ? ? ? ? ? s.Paste()

? ? ? ? ? ? ? ? ? ? ? ? ? ? doc1.Close()

? ? ? ? ? ? ? ? ? ? ? ? ? ? index[k,3] = 1

? ? ? ? ? ? ? ? ? ? ? ? ? ? file_mode = runs_path + str(j) + '.docx'

? ? ? ? ? ? ? ? ? ? ? ? ? ? doc = app.Documents.Open(file_mode)

? ? ? ? ? ? ? ? ? ? ? ? ? ? doc.Content.Copy()

? ? ? ? ? ? ? ? ? ? ? ? ? ? doc.Close()

? ? ? ? ? ? ? ? ? ? ? ? ? ? word = win32com.client.DispatchEx('Word.Application')

? ? ? ? ? ? ? ? ? ? ? ? ? ? doc1 = word.Documents.Open(top_path + "tttttt.docx")

? ? ? ? ? ? ? ? ? ? ? ? ? ? s = word.Selection

? ? ? ? ? ? ? ? ? ? ? ? ? ? s.MoveRight(1, doc1.Content.End)

? ? ? ? ? ? ? ? ? ? ? ? ? ? s.Paste()

? ? ? ? ? ? ? ? ? ? ? ? ? ? doc1.Close()

? ? ? ? ? ? ? ? ? ? ? ? ? ? glag = 0

? ? ? ? ? ? ? ? ? ? ? ? else:

? ? ? ? ? ? ? ? ? ? ? ? ? ? glag = 1

? ? ? ? ? ? ? ? ? ? else:

? ? ? ? ? ? ? ? ? ? ? ? glag = 1

? ? ? ? ? ? ? ? else:

? ? ? ? ? ? ? ? ? ? glag = 1

? ? ? ? ? ? ? ? if glag == 1:

? ? ? ? ? ? ? ? ? ? glag = 0

? ? ? ? ? ? ? ? ? ? file_mode = runs_path + str(j) + '.docx'

? ? ? ? ? ? ? ? ? ? doc = app.Documents.Open(file_mode)

? ? ? ? ? ? ? ? ? ? doc.Content.Copy()

? ? ? ? ? ? ? ? ? ? doc.Close()

? ? ? ? ? ? ? ? ? ? word = win32com.client.DispatchEx('Word.Application')

? ? ? ? ? ? ? ? ? ? doc1 = word.Documents.Open(top_path + "tttttt.docx")

? ? ? ? ? ? ? ? ? ? s = word.Selection

? ? ? ? ? ? ? ? ? ? s.MoveRight(1, doc1.Content.End)

? ? ? ? ? ? ? ? ? ? s.Paste()

? ? ? ? ? ? ? ? ? ? doc1.Close()

? ? ? ? ? ? #b = time.time()##############

? ? ? ? ? ? #print(b - a)

? ? ? ? #a = time.time()

? ? ? ? if j == len(row_list2)-1:

? ? ? ? ? ? file_mode = top_path + "tttttt.docx"

? ? ? ? ? ? if not os.path.exists(file_mode):

? ? ? ? ? ? ? ? indoc = docx.Document()

? ? ? ? ? ? ? ? indoc.save(file_mode)

? ? ? ? ? ? doc = app.Documents.Open(file_mode)

? ? ? ? ? ? doc.Content.Copy()

? ? ? ? ? ? doc.Close()

? ? ? ? ? ? word = win32com.client.DispatchEx('Word.Application')

? ? ? ? ? ? mkdir(ctj_path)? # 如果路徑不存在,則生成

? ? ? ? ? ? if not os.path.exists(ctj_path + "/" + title + ".docx"):

? ? ? ? ? ? ? ? indoc = docx.Document()

? ? ? ? ? ? ? ? indoc.save(ctj_path + "/" + title + ".docx")

? ? ? ? ? ? doc1 = word.Documents.Open(ctj_path + "/" + title + ".docx")

? ? ? ? ? ? s = word.Selection

? ? ? ? ? ? s.MoveRight(1, doc1.Content.End)

? ? ? ? ? ? s.Paste()

? ? ? ? ? ? doc1.Close()

? ? ? ? ? ? print(ctj_path + "/" + title + ".docx")

? ? ? ? ? ? with open("錄入.txt", "a+") as f:? # 追加寫入日志

? ? ? ? ? ? ? ? f.write(ctj_path + "/" + title + ".docx\n")

? ? ? ? docxxx = Document()

? ? ? ? docxxx.add_paragraph()

? ? ? ? docxxx.save(top_path + "tttttt.docx")

? ? ? ? #b = time.time()

? ? ? ? #print(b - a)

? ? ? ? glag = 0

with open("錄入.txt","a+") as f: #追加寫入日志

? ? f.write("正常完成\n")

with open("日志.txt","a+") as f: #追加寫入日志

? ? f.write("正常完成\n")

c = wmi.WMI()

for process in c.Win32_Process(name="WINWORD.EXE"):

? ? process.Terminate()

print("錯(cuò)題集正常生成完成,請關(guān)閉。")

input()


#print(index) WINWORD.EXE

#st.write()




jhpy錯(cuò)題集自動生成程序的評論 (共 條)

分享到微博請遵守國家法律
孟津县| 舟山市| 冕宁县| 林口县| 华安县| 香港| 息烽县| 浦县| 绿春县| 巩义市| 宜兰县| 临高县| 徐闻县| 临泉县| 曲阳县| 无棣县| 华阴市| 万安县| 台安县| 丰原市| 通山县| 定日县| 财经| 浏阳市| 台湾省| 修水县| 文水县| 游戏| 平度市| 普定县| 昌吉市| 兴业县| 凤翔县| 石棉县| 连云港市| 开原市| 湘潭县| 容城县| 石城县| 中超| 休宁县|