i have this script for summarizing text and want to take the input from html text fields to input it to the script and them show the results on the page.
i currently have
title = raw_input('Type a title for the text here:')
content = raw_input('Type the text to be summarized here:')
how can i change this to get the input from the html form?
Title:< input type = "text>
Content:< input type = "text>
-
Is this in the context of a website, or do you want to use an offline webpage?rlms– rlms2014年02月17日 17:42:15 +00:00Commented Feb 17, 2014 at 17:42
-
Why do you want to do this?rlms– rlms2014年02月17日 18:31:46 +00:00Commented Feb 17, 2014 at 18:31
-
to make it easier to use the script on possibly put it onlineuser3213259– user32132592014年02月17日 18:33:27 +00:00Commented Feb 17, 2014 at 18:33
1 Answer 1
I am not sure what do you mean when you say you want it as an offline webpage. You will need to use a server to handle that. This article here: http://docs.python.org/2/howto/webservers.html explains such a system. Once you are ready to put this on a server, you may take a look at http://learnpythonthehardway.org/book/ex51.html on how to handle web-forms with python.