Browse Source

sauvegarde

master
corentin.bollet 1 year ago
parent
commit
b07218df64
  1. BIN
      __pycache__/interface.cpython-38.pyc
  2. BIN
      __pycache__/personnage.cpython-38.pyc
  3. 23
      base_de_donnee.py
  4. BIN
      jdr_base.db

BIN
__pycache__/interface.cpython-38.pyc

Binary file not shown.

BIN
__pycache__/personnage.cpython-38.pyc

Binary file not shown.

23
base_de_donnee.py

@ -1,11 +1,28 @@
import sqlite3
class BaseDeDonnee:
def __init__(self):
self.con = sqlite3.cursor("table_personnages.db")
def __init__(self, nom):
self.nom = nom
self.con = sqlite3.connect("jdr_base.db")
self.cur = self.con.cursor()
self.cur.execute("CREATE TABLE IF NOT EXISTS "+self.nom+" (id INT PRIMARY KEY NOT NULL,nom VARCHAR(100),categorie VARCHAR(100),exp INT)")
self.con.commit()
self.con.close()
def __str__(self):
self.con = sqlite3.connect("jdr_base.db")
self.cur = self.con.cursor()
self.cur.execute("CREATE TABLE persos (nom)")
res = self.cur.execute("SELECT * FROM "+self.nom).fetchall()
self.con.commit()
self.con.close()
return str(res)
def ajouter_personnage(self):
pass

BIN
jdr_base.db

Binary file not shown.
Loading…
Cancel
Save