Python Forum
Should I se SQLite to create a simple High-scores database?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Should I se SQLite to create a simple High-scores database?
#1
Hi,

I'm quite new to programming and am currently making an LAN 2D Shooter on Python3 (Pygame). For my game, the player will have the option to log in or sign up and their highscores and login details (username and encrypted password) are going to be stored in a database.

I only have one talbe with 4 fields (Primary Key ID, Username, Password and High-score). Would there be an advantage of using Sqlite instead of something like a csv file? I've heard that sqlite is mainly for relational databases, but do you think it would be appropriate for this?

I'm going to be storing just the player's own highscores locally btw. Any advice on this matter would be helpful, thanks :)
Reply
#2
Quote:sqlite is mainly for relational databases
Sqlite3 is a relational data base management system (DBMS), it's not like one.

It would be perfectly OK to use Sqlite3, but simpler to arrange your data in memory as a dictionary, and then store as a JSON file.
Or arrange as a data frame an save with pandas.

Using sqlite3 with python is quite simple, see: https://docs.python.org/2/library/sqlite3.html
Reply
#3
Oh ok, I was confused because sqlite is known for relational databases so I didn't know if it would be ok to do a flatfile on it. Thanks for the help.
Reply
#4
There are also simple and good databases like TinyDB or dataset.
Here a test a did with dataset some years ago.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Create database in python module ? Johnse 5 2,856 Sep-05-2019, 04:14 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020