Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def showpage():
- ...
- test = [1,2,3,4,5,6]
- return render_template("sample.html",test=test)
- <script> var counts = {{test}}; </script>
- def showpage():
- ...
- test = [1,2,3,4,5,6]
- test = json.dumps(test)
- return render_template("sample.html",test=test)
- <script> var counts = JSON.parse("{{ test }}"); </script>
- <script> var counts = {{ test|tojson }}; </script>
- from flask import json
- return render_template("sample.html",test=json.dumps(test))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement