-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.py
22 lines (17 loc) · 765 Bytes
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from module import Make_BOJ_Table
import argparse
import json
def get_arguments():
parser = argparse.ArgumentParser()
parser.add_argument('--sort', '-s', nargs='*',
help='Example) p_id(default), tier', default=['p_id'], dest='sort')
parser.add_argument('--direction', '-d', nargs='*',
help='Example) desc(default), asc', default=['desc'], dest='direction')
sort_option: str = parser.parse_args().sort[0]
direction_option: str = parser.parse_args().direction[0]
return [sort_option, False if direction_option == 'asc' else True]
if __name__ == "__main__":
args = get_arguments()
with open('./init.json') as init:
MBT = Make_BOJ_Table(json.load(init))
MBT.run(args)