From bfce303263588674f6b34dcfbc92caa4872866c2 Mon Sep 17 00:00:00 2001 From: 965 Date: Sat, 3 Aug 2024 13:05:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E8=8C=83=E8=B5=84=E6=BA=90=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChaoxingDocumentCapture/scripts.py | 14 -------- iSmartAnsAnalize/scripts.py | 53 ------------------------------ temp.py | 12 ------- 3 files changed, 79 deletions(-) delete mode 100644 ChaoxingDocumentCapture/scripts.py delete mode 100644 iSmartAnsAnalize/scripts.py diff --git a/ChaoxingDocumentCapture/scripts.py b/ChaoxingDocumentCapture/scripts.py deleted file mode 100644 index 2b4b83f..0000000 --- a/ChaoxingDocumentCapture/scripts.py +++ /dev/null @@ -1,14 +0,0 @@ -import os -import glob -while True: - data = input() - print("\n") - data = data.rsplit('/', 1) - maxpic = int(str(data[1]).split('.')[0]) - suffix = '.png' - for i in range(1, maxpic + 1): - print(data[0] + f"/{i}" + suffix) - print("\n") - path = 'C:/Users/965/Downloads' - for infile in glob.glob(os.path.join(path, '*.png')): - os.remove(infile) diff --git a/iSmartAnsAnalize/scripts.py b/iSmartAnsAnalize/scripts.py deleted file mode 100644 index 31acc48..0000000 --- a/iSmartAnsAnalize/scripts.py +++ /dev/null @@ -1,53 +0,0 @@ -# encoding utf-8 -import linecache -import re -import os - - -def opentxt(num, path, name, line): - filename = '.\\{0}\\{1}{2}.txt'.format(path, num, name) - cont = linecache.getline(filename, line) - return cont - - -def savetxt(num, path, inv, name, character): - filename = '.\\{0}\\{1}{2}.txt'.format(path, num, name) - with open(filename, 'w', encoding='UTF-8') as txt: - txt.write(inv.replace(character, '\n')) - - -def txtsearch(num, path, character): - filename = '.\\{0}\\{1}_Response.txt'.format(path, num) - txt = open(filename, 'r', encoding='UTF-8') - lines = txt.readlines() - for lines in lines: # 对TXT 进行逐行读取 - if character in lines: - return lines - txt.close() - - -count = 2 -while count < 26: - content = txtsearch(count, 'response', 'answer') - texts = re.findall(r'.*<\\/answers>', content) - texts = str(texts) - texts = re.findall(r'CDATA\[.]', texts) - texts = str(texts) - texts = texts.replace("'CDATA[]]'", '\n') - texts = texts.replace("CDATA", '') - savetxt(count, 'Ans', texts, 'ans', ',') - count += 1 - -os.chdir(r"C:/Users/965/Builds/iSmartAnsCatch/Ans") -filedir = "C:/Users/965/Builds/iSmartAnsCatch/Ans" -f = open('../Ans.txt', 'w') -# 遍历文件名 -for i in range(2, 26): - filename1 = str(i) + 'ans.txt' - if i > 0: - filepath = filedir + '/' + filename1 - # 遍历单个文件 读取行数 - for line1 in open(filepath, encoding='UTF-8'): - f.writelines(str(i - 1) + line1) - f.write('\n') -f.close() diff --git a/temp.py b/temp.py index f4ffd6b..8b13789 100755 --- a/temp.py +++ b/temp.py @@ -1,13 +1 @@ -import pyautogui -# 获取屏幕分辨率 -screen_width, screen_height = pyautogui.size() - -# 获取按钮的坐标 -button_x, button_y = pyautogui.locateCenterOnScreen('button.png') - -# 移动鼠标到按钮的位置 -pyautogui.moveTo(button_x, button_y) - -# 单击按钮 -pyautogui.click()