Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use Python with a database?

I wrote a Python program that handles very large data. As it processes the data, it puts the processed data into an array, which easily grows to hundreds of megabytes or even over a gigabyte.

The reason I set it like that is because Python needs to continuously access the data in the array. Because the array gets larger and larger, the process is easily prone to error and very slow.

Is there a way to have the array-like database stored on a different file or database module and access it on a as-needed basis?

Perhaps this is a very basic task, but I have no clue.

like image 712
ytrewq Avatar asked Nov 02 '22 23:11

ytrewq


1 Answers

  1. You can use sqlite3 if you want. it is part of the python packages, it is simpler for basic usage.
  2. MySQL for python
  3. Postgres for python
like image 183
0x90 Avatar answered Nov 08 '22 08:11

0x90