forked from yunicoder/create-clearning-team
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
39 lines (31 loc) · 1.17 KB
/
main.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
import argparse
import tomlkit as toml
from decide_team import DecideTeam
def output_team_toml(team):
team_dict = dict()
for i, group in enumerate(team):
team_dict[f"g{i+1}"] = group
with open("results/created_team.toml", "w", encoding="utf-8") as f:
toml.dump(team_dict, f)
def output_slack(team):
output_str = ""
for i, group in enumerate(team):
output_str += f"{i+1}. "
for member in group:
output_str += f"@{member} "
output_str += "\n"
with open("results/output_team_for_slack.txt", "w", encoding="utf-8") as f:
print(output_str, file=f)
def main(args):
decide_team = DecideTeam(args.group_num)
team, not_first_cnt = decide_team.decide_team()
print("------ decide team! ------")
print(f"既に同じグループになったことのある組み合わせの数 : {not_first_cnt}")
print(team)
output_team_toml(team)
output_slack(team)
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--group_num', type=int, default=4, help='グループの数')
args = parser.parse_args()
main(args)