work
Topic sourcedef get_score_in(low, high): ' 返回指定分数区间的名字,按分数从低到高排序 ' with sqlite3.connect(db_file) as conn: cursor = conn.cursor() cursor.execute(r"select name from user where score between ? and ? order by score", (low, high)) rows = cursor.fetchall() cursor.close() conn.commit()
return [r[0] for r in rows]
- 1
4Neutrino
def get_score_in(low, high): ' 返回指定分数区间的名字,按分数从低到高排序 ' conn = sqlite3.connect(db_file) cursor = conn.cursor() cursor.execute(r"select name from user where score between ? and ? order by score", (low, high)) rows = cursor.fetchall() cursor.close() conn.commit() conn.close()