aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2014-11-14 16:18:05 -0500
committerThibaut Horel <thibaut.horel@gmail.com>2014-11-14 16:18:05 -0500
commitb04bc1925598263f11ef4a0d17c030e4010b790f (patch)
treeaa9cc918796cc640c8c8071578081034db39f391
parent2d250176d0f892406b583327ad9c0a91451f3b19 (diff)
downloadfamille-flask-b04bc1925598263f11ef4a0d17c030e4010b790f.tar.gz
Pep 8 and seed the rng in kadoscope
-rw-r--r--kadoscope.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/kadoscope.py b/kadoscope.py
index d4d605f..fe889b7 100644
--- a/kadoscope.py
+++ b/kadoscope.py
@@ -1,10 +1,13 @@
import random
import sqlite3
+
+random.seed()
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]))
+ c.execute('UPDATE users SET kado=? WHERE user_name=?',
+ (brothers[i], brothers[(i + 1) % 5]))
conn.commit()
conn.close()