
안녕하세요, templates 안에 제가 test.tex 파일을 app.py을 통해, subprocess.call을 해서, html으로 변경한 다음(make4ht라는 library가 있습니다), 그리고 test.html을 home으로 render_template을 통해 호출하려고 하는데,
현재 test_html이 templates directory 안에서 만들어지지 않고, 계속 바로 그 이전 directory에서 만들어집니다. 웹을 아무리 찾아봐도 어떻게 해야할지 모르겠습니다. 도움이 가능하다면 도와주세요.
from flask import Flask, render_template
import subprocess
subprocess.call(["make4ht", "C:/users/james/desktop/sparta/projects/prac/templates/test.tex",'mathjax'])
app = Flask(__name__)
@app.route("/")
def home():
return render_template("test.html")
@app.route('/mypage')
def mypage():
return 'This is Mypage!'
if __name__ == '__main__':
app.run('0.0.0.0',port=5000,debug=True)
제가 make4ht를 검색해보았을 떄, -d output을 직접 지정해주면 된다고 하였는데, 그것도 subprocess.call 안에서 어떻게 써야할지는 구글에서 검색을 못하겠습니다..ㅠㅠ
