#!/usr/bin/env python3
##################################################
#  Program setUpClass.py
#  12 Sep 2014:  program created
#  28 Aug 2023:  add full documentation
#                convert to modern format strings
#                convert to context managers
#  usages:
#       python makeThree.py rosterfile   
#  usage note: if you are running on UNIX with execute permissions, you can
#              omit the "python" in the two commands above if this file is located
#              in a directory in your $PATH.
#  product:
#       A folder is created for each name in the roster file
#       Each line of the roster file should contain a name (no spaces)
##################################################

import os.path
from sys import argv
if len(argv) < 2:
    print("Error: You must specify a roster of names")
    quit()
roster = []
with  open(argv[1], "r") as in_pipe:
    for name in in_pipe:
        name = name.strip()  #get rid of newline or spaces around the name
        roster.append(name)
for name in roster:
    os.system(f"mkdir {name}")
