已有工具v2的脚本中的os.mkdir()均改为makedir()
This commit is contained in:
parent
58ec422bb1
commit
5c0f92a64e
|
|
@ -19,7 +19,7 @@ def ReadTextFile(filepath): #读取文本格式的文件
|
|||
def SaveTextFile(data,filepath): #写入文本格式的文件
|
||||
pathname = os.path.dirname(filepath)
|
||||
if not os.path.exists(pathname):
|
||||
os.mkdir(pathname)
|
||||
makedir(pathname)
|
||||
with open(filepath,"w",encoding="u8") as f:
|
||||
f.write(data)
|
||||
return filepath #返回文件名
|
||||
|
|
|
|||
|
|
@ -16,10 +16,8 @@ content = pro_dict[id.zfill(6)]["content"]
|
|||
latex_raw = ReadTextFile("模板文件/独立文件模板.txt")
|
||||
|
||||
latexdata = StringSubstitute(r"<<待替换\d*>>",latex_raw,[content])
|
||||
try:
|
||||
os.mkdir("临时文件/pics")
|
||||
except:
|
||||
pass
|
||||
makedir("临时文件/pics")
|
||||
|
||||
|
||||
SaveTextFile(latexdata,"临时文件/pics/temp.tex")
|
||||
os.system("xelatex -interaction=batchmode -output-directory=临时文件/pics temp.tex")
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ answersheetseekingpath = "../备课组"
|
|||
|
||||
try:
|
||||
shutil.rmtree(tempdir)
|
||||
os.mkdir(tempdir)
|
||||
except:
|
||||
pass
|
||||
makedir(tempdir)
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Reference in New Issue