You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import sqlite3
|
|
|
|
|
|
|
|
class BaseDeDonnee:
|
|
|
|
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()
|
|
|
|
|
|
|
|
res = self.cur.execute("SELECT * FROM "+self.nom).fetchall()
|
|
|
|
|
|
|
|
|
|
|
|
self.con.commit()
|
|
|
|
self.con.close()
|
|
|
|
return str(res)
|
|
|
|
|
|
|
|
def ajouter_personnage(self):
|
|
|
|
pass
|
|
|
|
|