def get_score_in(low, high):
try:
conn = sqlite3.connect('test.db')
cursor = conn.cursor()
cursor.execute('select name,score from user where score <= ? and score >= ? order by score',(high,low))
values = cursor.fetchall()
except Exception as e:
print('Error:'.e)
finally:
cursor.close()
conn.close()
l=list(name[0] for name in values)
return l
Sign in to make a reply
群星我的归宿
def get_score_in(low, high):
try:
conn = sqlite3.connect('test.db')
cursor = conn.cursor()
cursor.execute('select name,score from user where score <= ? and score >= ? order by score',(high,low))
values = cursor.fetchall()
except Exception as e:
print('Error:'.e)
finally:
cursor.close()
conn.close()
l=list(name[0] for name in values)
return l