diff --git a/bdd.db b/bdd.db new file mode 100644 index 0000000..bcb5e40 Binary files /dev/null and b/bdd.db differ diff --git a/main.py b/main.py index afc8419..63a66e2 100644 --- a/main.py +++ b/main.py @@ -1,3 +1,8 @@ +import tkinter as tk +from urllib.request import urlopen +import PIL + + class Carte: def __init__(self,valeur, couleur): self.valeur = valeur @@ -11,4 +16,22 @@ class Carte: return -1 elif self.valeur == self.other : return 0 - return None \ No newline at end of file + return None + + +class Gui: + def __init__(self) -> None: + self.win = tk.Tk() + src = 'http://www.iro.umontreal.ca/~reid/ift1146/E06/classic-cards/1.png' + url = urlopen(src) + raw_data = url.read() + print(raw_data) + url.close() + b64_data = encodestring(raw_data) + print(b64_data) + image = tk.PhotoImage(b64_data) + self.can = tk.Canvas(self.win, width=320, height=320) + self.can.create_image(200, 200, image=image) + self.can.pack() + self.win.mainloop() +Gui() \ No newline at end of file diff --git a/photo/10.png b/photo/10.png new file mode 100644 index 0000000..f8d5deb Binary files /dev/null and b/photo/10.png differ diff --git a/photo/100.png b/photo/100.png new file mode 100644 index 0000000..3ff8aa6 Binary files /dev/null and b/photo/100.png differ diff --git a/photo/11.png b/photo/11.png new file mode 100644 index 0000000..f0f7d79 Binary files /dev/null and b/photo/11.png differ diff --git a/photo/12.png b/photo/12.png new file mode 100644 index 0000000..465d962 Binary files /dev/null and b/photo/12.png differ diff --git a/photo/13.png b/photo/13.png new file mode 100644 index 0000000..70c085b Binary files /dev/null and b/photo/13.png differ diff --git a/photo/14.png b/photo/14.png new file mode 100644 index 0000000..ca08035 Binary files /dev/null and b/photo/14.png differ diff --git a/photo/15.png b/photo/15.png new file mode 100644 index 0000000..99d1ef3 Binary files /dev/null and b/photo/15.png differ diff --git a/photo/16.png b/photo/16.png new file mode 100644 index 0000000..2b98730 Binary files /dev/null and b/photo/16.png differ diff --git a/photo/17.png b/photo/17.png new file mode 100644 index 0000000..888cdd6 Binary files /dev/null and b/photo/17.png differ diff --git a/photo/18.png b/photo/18.png new file mode 100644 index 0000000..66ea2f1 Binary files /dev/null and b/photo/18.png differ diff --git a/photo/19.png b/photo/19.png new file mode 100644 index 0000000..30f93d2 Binary files /dev/null and b/photo/19.png differ diff --git a/photo/20.png b/photo/20.png new file mode 100644 index 0000000..2dcf08e Binary files /dev/null and b/photo/20.png differ diff --git a/photo/200.png b/photo/200.png new file mode 100644 index 0000000..536a3be Binary files /dev/null and b/photo/200.png differ diff --git a/photo/21.png b/photo/21.png new file mode 100644 index 0000000..2228cec Binary files /dev/null and b/photo/21.png differ diff --git a/photo/22.png b/photo/22.png new file mode 100644 index 0000000..273a1fe Binary files /dev/null and b/photo/22.png differ diff --git a/photo/23.png b/photo/23.png new file mode 100644 index 0000000..f649c8d Binary files /dev/null and b/photo/23.png differ diff --git a/photo/24.png b/photo/24.png new file mode 100644 index 0000000..d5833b2 Binary files /dev/null and b/photo/24.png differ diff --git a/photo/25.png b/photo/25.png new file mode 100644 index 0000000..539f327 Binary files /dev/null and b/photo/25.png differ diff --git a/photo/26.png b/photo/26.png new file mode 100644 index 0000000..b7446cb Binary files /dev/null and b/photo/26.png differ diff --git a/photo/27.png b/photo/27.png new file mode 100644 index 0000000..6e274b2 Binary files /dev/null and b/photo/27.png differ diff --git a/photo/28.png b/photo/28.png new file mode 100644 index 0000000..48dbe15 Binary files /dev/null and b/photo/28.png differ diff --git a/photo/29.png b/photo/29.png new file mode 100644 index 0000000..aca12f2 Binary files /dev/null and b/photo/29.png differ diff --git a/photo/30.png b/photo/30.png new file mode 100644 index 0000000..ee77ee9 Binary files /dev/null and b/photo/30.png differ diff --git a/photo/300.png b/photo/300.png new file mode 100644 index 0000000..534cf09 Binary files /dev/null and b/photo/300.png differ diff --git a/photo/31.png b/photo/31.png new file mode 100644 index 0000000..1a99572 Binary files /dev/null and b/photo/31.png differ diff --git a/photo/32.png b/photo/32.png new file mode 100644 index 0000000..8d97797 Binary files /dev/null and b/photo/32.png differ diff --git a/photo/33.png b/photo/33.png new file mode 100644 index 0000000..9293ed3 Binary files /dev/null and b/photo/33.png differ diff --git a/photo/34.png b/photo/34.png new file mode 100644 index 0000000..edc65b5 Binary files /dev/null and b/photo/34.png differ diff --git a/photo/35.png b/photo/35.png new file mode 100644 index 0000000..5a26cbb Binary files /dev/null and b/photo/35.png differ diff --git a/photo/36.png b/photo/36.png new file mode 100644 index 0000000..b21a3ee Binary files /dev/null and b/photo/36.png differ diff --git a/photo/37.png b/photo/37.png new file mode 100644 index 0000000..451ac6a Binary files /dev/null and b/photo/37.png differ diff --git a/photo/38.png b/photo/38.png new file mode 100644 index 0000000..5cf3bcf Binary files /dev/null and b/photo/38.png differ diff --git a/photo/39.png b/photo/39.png new file mode 100644 index 0000000..a8a4236 Binary files /dev/null and b/photo/39.png differ diff --git a/photo/40.png b/photo/40.png new file mode 100644 index 0000000..4bf1de9 Binary files /dev/null and b/photo/40.png differ diff --git a/photo/400.png b/photo/400.png new file mode 100644 index 0000000..d98a7c4 Binary files /dev/null and b/photo/400.png differ diff --git a/photo/41.png b/photo/41.png new file mode 100644 index 0000000..cc72540 Binary files /dev/null and b/photo/41.png differ diff --git a/photo/42.png b/photo/42.png new file mode 100644 index 0000000..2c93a21 Binary files /dev/null and b/photo/42.png differ diff --git a/photo/43.png b/photo/43.png new file mode 100644 index 0000000..30d06de Binary files /dev/null and b/photo/43.png differ diff --git a/photo/44.png b/photo/44.png new file mode 100644 index 0000000..dd2418b Binary files /dev/null and b/photo/44.png differ diff --git a/photo/45.png b/photo/45.png new file mode 100644 index 0000000..d9435b4 Binary files /dev/null and b/photo/45.png differ diff --git a/photo/46.png b/photo/46.png new file mode 100644 index 0000000..c8d38f0 Binary files /dev/null and b/photo/46.png differ diff --git a/photo/47.png b/photo/47.png new file mode 100644 index 0000000..72a3bda Binary files /dev/null and b/photo/47.png differ diff --git a/photo/48.png b/photo/48.png new file mode 100644 index 0000000..5132549 Binary files /dev/null and b/photo/48.png differ diff --git a/photo/49.png b/photo/49.png new file mode 100644 index 0000000..c46843a Binary files /dev/null and b/photo/49.png differ diff --git a/photo/5.png b/photo/5.png new file mode 100644 index 0000000..cf1f723 Binary files /dev/null and b/photo/5.png differ diff --git a/photo/50.png b/photo/50.png new file mode 100644 index 0000000..ae7ba22 Binary files /dev/null and b/photo/50.png differ diff --git a/photo/51.png b/photo/51.png new file mode 100644 index 0000000..ed95e56 Binary files /dev/null and b/photo/51.png differ diff --git a/photo/52.png b/photo/52.png new file mode 100644 index 0000000..8278642 Binary files /dev/null and b/photo/52.png differ diff --git a/photo/6.png b/photo/6.png new file mode 100644 index 0000000..3072ea3 Binary files /dev/null and b/photo/6.png differ diff --git a/photo/7.png b/photo/7.png new file mode 100644 index 0000000..7274ece Binary files /dev/null and b/photo/7.png differ diff --git a/photo/8.png b/photo/8.png new file mode 100644 index 0000000..17ba2c2 Binary files /dev/null and b/photo/8.png differ diff --git a/photo/9.png b/photo/9.png new file mode 100644 index 0000000..fd9d3b5 Binary files /dev/null and b/photo/9.png differ diff --git a/script.sh b/script.sh new file mode 100755 index 0000000..399a826 --- /dev/null +++ b/script.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# script pour récupérer les images de carte qur internet + +for i in $( seq 52 ) +do + curl "http://www.iro.umontreal.ca/~reid/ift1146/E06/classic-cards/$i.png" -o "photo/$i.png" +done + diff --git a/setup_table.py b/setup_table.py new file mode 100644 index 0000000..3f5420e --- /dev/null +++ b/setup_table.py @@ -0,0 +1,15 @@ +import sqlite3 +import subprocess +# programme pour créer toute la table de donnée. Ne pas analyser en détails c'est moche et mal fait + +# liste des chemins des cartes +cards = subprocess.run(['ls', '-v', 'photo'], text=True, stdout=subprocess.PIPE).stdout.split('\n') + +conn = sqlite3.connect('bdd.db') +c = conn.cursor() +compteur = 0 +for i in range(13, 0, -1): + for couleur in ["trèfle", "pique", "coeur", "carreau"]: + c.execute("INSERT INTO Cartes VALUES(?,?,?,?) ", (couleur, i, (i>=7 or i==1), "photo/"+cards[compteur])) + conn.commit() + compteur += 1