-1

I am using flask for I website project and vould like to simply send a text (or just a string) from HTML to python. I want to do this using python and html only - no Java Script if possible. I found a lot of simmilar questions here on stackoverflow but most of them were based on python to html or html to python using JS. Any ideas ?

gasper101
  • 835
  • 2
  • 5
  • 8

2 Answers2

3

You can use the form to transfer the data from HTML to the flask. Make input type hidden and set value that you want to pass.

Pruthvi Hingu
  • 224
  • 2
  • 10
1

If you want form data, then you can get it like

from flask import request
var_name = request.form['name_attr']