나는 데카르트 제품을 계산하는 데 사용하는 몇 가지 목록이 :플라스크에서 Jinja 템플릿에 파이썬 목록을 어떻게 인쇄합니까?
python.py :
@app.route('/output', methods = ['GET','POST'])
def output():
a = ['one','two']
b = ['three','four']
c = ['five']
d = ['six','seven','eight']
e = ['nine','ten','eleven']
cpl = list(itertools.product(a,b,c,d,e))
return render_template('output.html',cpl = cpl)
가 output.html 그러나
{% for cp in cpl %}
<p>{{ cp }} </p>
{% endfor %}
, 나는 빈 화면이 반환하고 .
Jupyter에서 동일한 파이썬 코드를 실행할 때 목록이 반환됩니다.
어디에서 문제가 생길 수 있습니까?
것은 그냥있을 수 있습니다 현재 설정에 문제가 있습니다. 로컬에서 코드를 실행했는데 예상되는 결과를 얻었습니다. –