简体   繁体   English

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

[英]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.

相关问题 如何从表单中获取实时输入并打印? - How can I take live input from a form, and print it? 如何仅在 HTML/JQuery 中获取从 1 到 10 的输入? - How can I take input from 1 to 10 only in HTML/JQuery? Jquery可以直接从表单中获取表单输入,还是必须在脚本中使用SET按钮? - Can Jquery take the form input straight from the form, or do I have to use a SET button in my script? 如何通过输入表单将对象数组添加到html列表? - How can I add array of object to html list by input form? 如何从“表格”中提取2个数字并将其相加,以便输出结果 - How can I take 2 numbers from “form” and add them so I can output the result 如何使用 javascript 索引来自 HTML 表单的输入? - How can I use javascript to index input from a HTML form? 将HTML形式的输入输入到Javascript中? - Take input from HTML form into Javascript? 如何从一种形式的输入字段中获取数据,并使用JQuery使用它以另一种形式填充相同的输入类型? - How can I take data from one an input field of one form and use it to populate the same input type in a different form using JQuery? 如何从 html 按钮执行 python 脚本? - How can I execute a python script from an html button? 如何基于我在HTML表单上的用户输入来更新PHP脚本 - How can I update my PHP script based on my user input on HTML form
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM