Advertisement
Guest User

Untitled

a guest
Aug 24th, 2016
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. with sqlite3.connect('pandemic.db') as conn:
  2.     tobedone = """SELECT pos FROM table ORDER BY pos ASC;"""
  3.     cursor.execute( tobedone )
  4.     conn.commit()
  5.     answerZ = cursor.fetchall ()
  6.     posnew = answerZ [2]
  7.     maxposnew = posnew [0]
  8.     tobedone = '''UPDATE epTBL SET pos = ABS(RANDOM() % 70);'''
  9.     cursor.execute( tobedone )
  10.     conn.commit()
  11.     tobedone = '''UPDATE epTBL SET pos = %s;''' % (maxposnew)
  12.     cursor.execute( tobedone )
  13.     conn.commit()
  14.     tobedone = '''UPDATE epTBL SET pos = ABS(RANDOM() % %s);''' % (maxposnew)
  15.     cursor.execute( tobedone )
  16.     conn.commit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement