dev
a 2 years ago
parent c2b1f74d50
commit a1ef8e2365
  1. 11
      weight-rank.md

@ -10,4 +10,15 @@
data1.extend(sort_site(data.charge))
# 打乱
random.shuffle(data.miao_zhan)
```
```python
def sort_site(items, gfw=True):
items = sorted(items, key=lambda x: x.weight, reverse=True)
if gfw:
items_g = [x for x in items if x.gfw == 1]
items_g.extend([x for x in items if x.gfw != 1])
items = items_g
return items
```
Loading…
Cancel
Save