0

I have a html page with text box and submit button. When somebody enters data in text box and click submit, i have to pass that value to a python script which does some operation and print output. Can someone let me now how to achieve this. I did some research on stackoverflow/google but nothing conclusive. I have python 2.7, Windows 10 and Apache tomcat. Any help would be greatly appreciated.

Thanks, Jagadeesh.K

2
  • Why must it be a command line script? It sounds like you should probably convert the python script into a web app. After that, when the form is submitted, send a request to the web app with the content from the text box in the body. Commented Jun 25, 2018 at 14:10
  • Hi Jack, I have to pass parameters to python script from html when user clicks on submit button. Yes even i'm planning to do the same. I have apache tomcat and i placed my html page and python script under webapps folder. My question is how to pass parameters to python script from html and how to retrieve in python script. Thanks again for quick help. Commented Jun 25, 2018 at 15:13

2 Answers 2

2

You need to use a python web-framework of some sort. I suggest giving Django project a try. It has a great tutorial.

Sign up to request clarification or add additional context in comments.

Comments

0

Short answer: You can't just run a python script in the clients browser. It doesn't work that way.

If you want to execute some python when the user does something, you will have to run a web app like the other answer suggested.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.