如何从html表单中获取输入并添加到python脚本

时间:2014-02-17 17:39:35

标签: javascript jquery python html

我有这个用于汇总文本的脚本,并希望从html文本字段中输入输入到脚本中,然后在页面上显示结果。

我目前有

title = raw_input('Type a title for the text here:')
content = raw_input('Type the text to be summarized here:')

如何更改此内容以获取html表单的输入?

Title:< input type = "text>
Content:< input type = "text>

1 个答案:

答案 0 :(得分:1)

当您说要将其作为离线网页时,我不确定您的意思。您将需要使用服务器来处理它。这篇文章:http://docs.python.org/2/howto/webservers.html解释了这样一个系统。一旦准备好将它放在服务器上,您可以查看http://learnpythonthehardway.org/book/ex51.html如何使用python处理Web表单。