How to create a code in python and connect it to Mysql [closed]

-4

Ee Galera, I'm learning the database language, but I still do not know everything so I came here to ask for help for you to know how I can do this. I know there is sqlite3 in python but I want to use mysql, which in the case I'm working with in linux. Then I want to type Create a code in Python in which the user runs the program and enters and registers the employees of the company there that this program saves in a database (is it possible to put the database as if it were online there the program connect to the bank and is saving?) every time he logs in he picks up and asks for the password, until then, okay I already have a clue how to do it, but my problem is how I create the database in the workbench and then I connect it in Python and then do insert data into it. Another point also that I am in doubt is type if you have how I put the database online as I will connect the application in it and how I make changes in it type see that registered, add new tables, delete line and etc ... Help me I'm new here, I need tips and help please.

    
asked by anonymous 21.05.2017 / 23:46

1 answer

1

There are several ways to do this, without knowing the context is difficult to give an accurate answer. Will you use any framework to put the "application" in the air? Do you have a legacy bank or will you start from "scrap"? in both cases you can use Flask or Django, both use the database mapping strategy ( ORM ), flask uses the sqlalchemy , which you can use even if you do not use the flask, since Django uses its own ORM.

If you do not use any framework, and will develop with "pure" python, then surely my suggestion is sqlalchemy.

    
22.05.2017 / 00:03