Web Forms with Python

1

He has asked me to automate a load of some records in a SQL database, with id, cedula, departamento y tipo de pago with Python.

I have researched and found a framework called Flask, apparently it is simpler, but I have not managed to do it like the Google forms.

    
asked by Bryan Useche 07.09.2017 в 17:11
source

1 answer

1

Good, I suggest you use something like this:

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import web
from web import form

urls = ('/', 'ingreso')

app = web.application(urls, globals())

# Creamos nustro formulario:
login = form.Form(form.Textbox('usuario'),form.Password('clave'),form.Button('Iniciar'))

class ingreso:
    def GET(self):
        f = login()
        return f.render()

def main():
    app.run()
    return 0

if __name__ == "__main__": 
    main()

This offers you an exit like:

It's quite simple to use and understand. Here I leave a link to a mini- very complete tutorial of it. I hope it works.

    
answered by 07.09.2017 / 17:37
source