-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhas_number.py
45 lines (37 loc) · 1.32 KB
/
has_number.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
# -*- coding: utf-8 -*-
"""
Created on Mon May 18 09:40:30 2020
@author: Meaghan
"""
import csv
def __main__():
course = input('Course: ')
sem = input('Semester: ')
crs_this_sem = input('Course Running: ')
student_list = []
with open(f'{sem}/rosters/{course}.csv') as csv_file:
csv_reader = csv.reader(csv_file)
for row in csv_reader:
build_classes(row, student_list,sem,course)
for student in student_list:
running(student, crs_this_sem)
class Student:
def __init__(self, id_num, name, email):
self.id_num=id_num
self.name=name
self.email=email
self.com=[]
self.ip={}
def build_classes(info, student_list, sem,cou):
s = Student(info[0],info[1],info[2])
with open(str(sem) + '/transcripts/' + str(s.id_num) + '.csv') as csv_file:
csv_reader = csv.reader(csv_file)
for row in csv_reader:
if row[0]+row[1] in ['ARCH463','ARCH464','ARCH563']:
s.com.append(row[0]+row[1])
student_list.append(s)
def running(student, crs_run):
if student.com.count(crs_run) > 1:
needs = [c for c in ['ARCH463','ARCH464','ARCH563'] if c not in student.com]
print(student.name, ";", student.id_num, ";",needs)
__main__()