def sortlb():
ulbs = shelve.open('leaderboard')
utemp = ulbs['lb']
lbs.close()
ret = ['Leaderboard:']
pos = 0;
while len(temp) > 0:
largest = -1;
lindex = 0;
luser = ''
rentry = ''
pos = pos+1
for entry in utemp:
id = entry[:x]
name = entry[x+1:p]
points = entry[p+1:]
if points > largest:
largest = points
lindex = utemp.index(entry)
luser = name
rentry = pos+'. '+luser
ret.append(str(lindex)+'. '+rentry)
del utemp[utemp.index(lindex)]
return ret
相关功能:
console.log(this.props.myValue)
基本上我尝试将用户/点列表分为大多数到最少的点,在"用户名/用户ID中,点"格式,因为我不知道更好的方法,lol