aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2012-11-12 18:55:30 -0500
committerGuillaume Horel <guillaume.horel@gmail.com>2012-11-12 18:55:30 -0500
commit7e3c3f7a19e132e0cf513295de25914bcc156629 (patch)
tree8c0c21c33bd5345a82e4eb2f4c0a7a57d13045d2
parent425bbdb24d68ec4c1ed83c51f7b08de32ab50bd0 (diff)
downloadfamille-flask-7e3c3f7a19e132e0cf513295de25914bcc156629.tar.gz
Add function to draw kadoscope
-rw-r--r--kadoscope.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/kadoscope.py b/kadoscope.py
new file mode 100644
index 0000000..d4d605f
--- /dev/null
+++ b/kadoscope.py
@@ -0,0 +1,10 @@
+import random
+import sqlite3
+brothers = ["Guillaume", "Geoffroy", "Thibaut", "Bertrand", "Enguerrand"]
+random.shuffle(brothers)
+conn = sqlite3.connect('famille.db')
+c = conn.cursor()
+for i in range(5):
+ c.execute('UPDATE users SET kado=? WHERE user_name=?', (brothers[i], brothers[(i+1)%5]))
+conn.commit()
+conn.close()