How to run a python script from clicking a button on a HTML webpage?
You can't run python in html. You can just use javascript. but you can pass the information as json and then use javascript if you don't want to change the language or using python frameworks.
I currently have a python script that updates certain CSV files when ran (it web scrapes and updates the information of a CSV file). In my HTML page (index.html), I have a script tag inside index.html that reads the CSV file and displays it as a table on the webpage. However, what I now need to do is update the CSV file by pressing an HTML button on the webpage. This will update the CSV file so when I run the button to run the JS script, it will have updated values from the file.
I searched and found it very hard to understand what they meant by using flask and Django (I don't know anything about setting up servers). I don't want to set up a Django webpage because I want to work with my current pure HTML webpage I wrote.
I would appreciate it if the answer is up to date with the current standard solutions for running python scripts in HTML.
Please ask if you need more information. Thanks.