예제 #1
0
def populate_list6(self, period):
    self.group6_L.clear()
    roster = load_roster(period)
    x = ClassPeriod(roster)
    y = x.groups(6)
    for i in range(len(y[5])):
        self.group6_L.insertItem(i, y[5][i])
from roster_ops import add_roster, load_roster, edit_roster
from ClassPeriod import ClassPeriod

print('Hello, this is Random Group Creator!\nType "exit" at any time to quit.')

while True:
    choice = input(
        'Do you want to add a roster, load a roster, edit a roster, shuffle a roster, or create groups? '
    )
    choice = choice.lower()
    if choice == 'exit':
        break
    elif choice == 'add':
        add_roster()
    elif choice == 'load':
        print(load_roster())
    elif choice == 'edit':
        edit_roster()
    elif choice == 'shuffle':
        roster = load_roster()
        x = ClassPeriod(roster)
        x.show_roster()
        x.randomize()
    elif choice == 'groups':
        roster = load_roster('second')
        x = ClassPeriod(roster)
        n = input('How many groups? ')
        x.display_groups(int(n))

    else:
        print('Sorry, that answer didn\'t make sense to me.')
예제 #3
0
 def set_roster(self):
     ''' Load roster for this period. '''
     self.roster = load_roster(self.period)