[英]How can i take input from a html form and add to to a python script
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. 我有此脚本用于汇总文本,并希望从html文本字段中输入内容以将其输入到脚本中,并且它们在页面上显示结果。
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? 我如何更改它以从html表单获取输入?
Title:< input type = "text>
Content:< input type = "text>
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. 本文位于: http : //docs.python.org/2/howto/webservers.html解释了这样的系统。 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. 准备好将其放在服务器上后,您可以查看http://learnpythonthehardway.org/book/ex51.html ,了解如何使用python处理网络表单。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.