fix: 解决文件路径读取错误的问题;解决读取token时自带换行符的问题

This commit is contained in:
2022-12-14 16:44:48 +08:00
parent 4721805989
commit 52c246cf07
3 changed files with 10 additions and 4 deletions

View File

@ -1,8 +1,10 @@
import os
import re
from functools import partial
def getTemplate(filePath):
file = open(filePath, encoding='utf-8')
currentPath = os.path.dirname(__file__)
file = open(os.path.join(currentPath, filePath), encoding='utf-8')
fileData = file.read()
file.close()
return fileData