corentin.bollet
12 months ago
4 changed files with 20 additions and 3 deletions
Binary file not shown.
Binary file not shown.
@ -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 |
|||
|
|||
|
Binary file not shown.
Loading…
Reference in new issue