how to connect an app to a database with python?
<p>I'm new to python, so I want to know how to store the data in a database! </p>

<p>For a sample example, I want to store informations about users :</p>

<pre><code>ent1 = input('Enter your name: ')
ent2 = input('Enter your adress: ')
ent3 = int(input('Enter your number phone: '))
</code></pre>

<p>The question is how to connect the input with the database? </p>

<p>we can take the example of the sqlite3 that is preinstalled in python! and we suppose that we have a database called user.db connected to the cursur and a table called users that contains three columns (name, adress, number_phone)</p>

<p>thanks for the help!</p>

<p>You can emulate a database with Python objects.</p>

<p>Create a <code>dict,</code> and store all your data therein.</p>

<p>Then, serialise (<a href="https://docs.python.org/3/library/pickle.html" rel="nofollow"><code>pickle</code></a>) the data to disk (with <code>pickle.dump</code>) and next time you need to access/manipulate the data, use <code>pickle.load.</code></p>

python database sqlite3