A
A
Alexander Kharitonov2020-06-20 23:44:32
Python
Alexander Kharitonov, 2020-06-20 23:44:32

How to make a database in Python for a local program?

Good afternoon!
I don't have much experience, so the question may be simple.
I am writing a program in python that should use information and store it in a database. But I have never encountered this and I do not know how to approach this problem.
What is the best module to use? And if you also tell me where to study it, I will be very grateful.
Thank you!

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Maxim, 2020-06-20
@Khariton84

Try the sqlite3 module.
It is included in the standard library, so you don't even need to install anything.
Just at the beginning of the file:
import sqlite3
Here you can read more: https://m.habr.com/ru/post/321510/

G
galaxy, 2020-06-20
@galaxy

sqlite3

G
Guerro69, 2020-06-20
@Guerro69

For simple programs: sqlite3
For servers, bots: MySQL on phpmyadmin, python module: pymysql

S
selfkilla666, 2020-06-21
@selfkilla

If you need to store a HUGE amount of data, then maybe you really should use sqlite3 , but still, if you need to store small data, then it will be much easier for you to use json , on which there is already a lot of information especially for you:

  1. https://python-scripts.com/json
  2. https://pythonworld.ru/moduli/modul-json.html
  3. https://realpython.com/python-json/ (in English)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question