I want to have a html file with buttons, and when I click on a button it should run a python script and display the output onto the browser as a webpage. Any help would be appreciated.
Asked
Active
Viewed 587 times
1
-
Have the button link to a different endpoint and with flask serve the output into that endpoint – Dor-Ron Feb 06 '18 at 05:19
-
Have you tried any thing ? You want to do it with flask ? – Vikas Periyadath Feb 06 '18 at 05:23
-
@VikasDamodar Not really. Anything that helps me with this. – Sashaank Feb 06 '18 at 05:30
-
Try brython or flask (easier to get started with than django) – whackamadoodle3000 Feb 06 '18 at 05:33
-
The answer for your question cannot be completely explain here, So its better to take some tutorial about flask or Django ,they are good frameworks in python to create webprojects and then share your doubts here. – Vikas Periyadath Feb 06 '18 at 05:33
1 Answers
0
Not sure if you mean "run a python script" in the browser or on a server.
If you want to run a Python script in the web-browser, you could use JavaScript to execute a run process, launching the Python script. I don't think there's a way to execute a Python script natively in a browser.
In order to run a Python script on the server, you can use Django, it's exactly what Django was designed for. You can see Uku Loskit's answer regarding this topic here.

MikeyE
- 1,756
- 1
- 18
- 37