-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod.py
42 lines (33 loc) · 1.02 KB
/
mod.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env python3
import random
import os
import shutil
# com.zhiliaoapp.musically
def split_list(li, segments):
segment_size = len(li) // segments
remainder = len(li) % segments
segments_list = []
start = 0
for i in range(segments):
if i < remainder:
end = start + segment_size + 1
else:
end = start + segment_size
segments_list.append(li[start:end])
start = end
return segments_list
def get_userss():
with open("./etc/user_list.txt") as f:
username_list = []
for line in f.readlines():
username_list.append(line.replace("\n", ""))
random.shuffle(username_list)
# top_users = []
# with open("../etc/top_users.txt") as f:
# for line in f.readlines():
# top_users.append(line.replace("\n", ""))
# random.shuffle(top_users)
# top_users = top_users[:5]
# for top in top_users:
# username_list.insert(0, top)
return username_list