Example #1
0
 def load(self, path: str):
     try:
         with open(path, 'r', encoding='utf-8') as f:
             print("reading...")
             reader = csv.reader(f)
             self.courses = []
             for row in reader:
                 print(row)
                 course = Course()
                 course.from_list(row)
                 self.courses.append(course)
             print("done reading")
     except FileNotFoundError:
         print(f"< 找不到文件:\"{path}\" >")