This repository has been archived on 2024-06-23. You can view files and clone it, but cannot push or open issues or pull requests.
mathdeptv2/工具v2/文件或剪贴板提取答案.py

22 lines
527 B
Python

from database_tools import *
configjson = load_dict("文本文件/config.json")["文件或剪贴板提取答案.py"]
preamble = configjson["前缀"]
if configjson["来自剪贴板"] == True:
data = getCopy()
else:
data = ReadTextFile(configjson["文件地址"])
anslist = generateAnswerList(data,preamble)
output = "ans\n\n"
for id,ans in anslist:
if not ans == "暂无答案":
output += f"{id}\n{ans}\n\n"
SaveTextFile(output,"文本文件/metadata.txt")
os.system("code 文本文件/metadata.txt")