-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
46 lines (34 loc) · 1.36 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
40
41
42
43
44
45
46
import argparse
import json
from src.utils import hello
from src.table import Table
from src.openspace import OpenSpace
def main(name_path):
# Read config.json file
with open('config.json', 'r') as config_file:
config = json.load(config_file)
# Use the configuration variables
number_of_tables = config['number_of_tables']
table_capacity = config['table_capacity']
# Get the list of people from the hello function
people = hello(name_path)
print("There are ", len(people), "people that wait to be seated.")
# Create tables
tables = [Table(table_capacity) for _ in range(number_of_tables)]
# Create an OpenSpace instance with the tables
open_space = OpenSpace(tables, number_of_tables)
# Organize people in OpenSpace
open_space.organize(people)
# Display the seating arrangement
open_space.display()
# Store the seating arrangement in file
open_space.store('org_colleagues.txt')
if __name__ == "__main__":
# Create an argument parser
parser = argparse.ArgumentParser(description="Process the path of the input file.")
# Add an argument for the input file path
parser.add_argument('input_file_path', type=str, help='Path to the input file')
# Parse the arguments
args = parser.parse_args()
# Call the main function with the input file path
main(args.input_file_path)