def get_score_in(low, high):
try:
conn=sqlite3.connect('test.db')
cursor=conn.cursor()
cursor.execute('select * from user where score>=? and score<=? order by score',(low,high))
values=cursor.fetchall()
finally:
cursor.close()
conn.close()
return [ value[1] for value in values ]
Sign in to make a reply
灿_Clarence
def get_score_in(low, high):
try:
conn=sqlite3.connect('test.db')
cursor=conn.cursor()
cursor.execute('select * from user where score>=? and score<=? order by score',(low,high))
values=cursor.fetchall()
finally:
cursor.close()
conn.close()
return [ value[1] for value in values ]