规范资源位置

This commit is contained in:
965 2024-08-03 13:05:36 +08:00
parent 196fc7ec50
commit bfce303263
3 changed files with 0 additions and 79 deletions

View File

@ -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)

View File

@ -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>.*<\\/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()

12
temp.py
View File

@ -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()