0
<script>
var idd;
var counts = {{ test|tojson }};
var texts= "";
for (i = 1; i < counts.length; i=i+2){
    texts=parseInt(count[i-1]);
    document.write("<a href=\"{{url_for('ques',idd=texts)}}\">"+counts[i]+"</a></br></br>");
}
</script>



@app.route('/ques/<int:idd>', methods=['GET', 'POST'])
def ques(idd):
    print idd

This throws the following error:

ValueError: invalid literal for int() with base 10: 'texts'

Tonechas
  • 13,398
  • 16
  • 46
  • 80
potter
  • 1
  • 1
    Well the error says it: your value is a `texts`, not an **integer**. So Python fails to parse that... – Willem Van Onsem Mar 27 '17 at 12:45
  • well,if i change the code as: @app.route('/ques/', methods=['GET', 'POST']) it prints texts as output but NOT the value of texts!! @willem Van Onsem – potter Mar 27 '17 at 12:57

0 Answers0