How do I add n number of input fields depending on a passed value?

This question already has an answer here:

  • How do I parse a string to a float or int in Python? 22 answers

  • You can use float() to parse your voc_count variable (which is a string) as a number, and then use int() to further convert it to an integer value. Once you've done that, you should be able to base a for loop around the value of voc_count .

    voc_count = int(float(request.form['count']))
    
    链接地址: http://www.djcxy.com/p/48442.html

    上一篇: 如果陈述会话烧瓶

    下一篇: 如何根据传递的值添加n个输入字段?