A
A
Alexander Pupkin2015-10-20 18:50:39
Python
Alexander Pupkin, 2015-10-20 18:50:39

Working with form in Python?

Hello. I am slowly learning Python. Interested in how to collaborate with Python via index.html.
There is html:

<form  action="py/t.py" method="POST">
<input type="text" />
<input type="submit" value="OK" />
</form>

There is some Python code:
code
How to properly process / get the entered number into the form, process this number in the script, return the result? Where to dig? Who to yell at? Thank you.
PS All files on the desktop, in a simple folder =)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Roman Kitaev, 2015-10-20
@deliro

You need an http server. Let's say it comes with the Flask framework. If you swing more abruptly - Django. But if it's quite simple - turn here or here to the third version.

A
Alexander, 2015-10-20
@NeiroNx

If you forget about frameworks, then it is better to use the GET method - then it is easier to parse the data than with the POST method. They will all be in the first line sent by the client to the server. There you can already get by with several split

S
ssi, 2015-10-20
@ssi

Also look at uwsgi.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question