In the code there were some parts that read/open different file formats. These were not handled if the file does not exist. It will just throw an error and the application will crash.
An example of where this could be improves is in the file profile_class.py (Personal_Task_Manager -> src -> profile_class.py), in this code snippet. My suggesiton is to add a check to ensure the file exists before attempting to read it. If the file doesn't exist then initialize an empty dataframe.
def load_tasklist(self): """Load tasklist from CSV.""" self.tasklist = pd.read_csv('tasklist.csv') self.tasklist['Deadline'] = pd.to_datetime(self.tasklist['Deadline'])
In the code there were some parts that read/open different file formats. These were not handled if the file does not exist. It will just throw an error and the application will crash.
An example of where this could be improves is in the file profile_class.py (Personal_Task_Manager -> src -> profile_class.py), in this code snippet. My suggesiton is to add a check to ensure the file exists before attempting to read it. If the file doesn't exist then initialize an empty dataframe.
def load_tasklist(self): """Load tasklist from CSV.""" self.tasklist = pd.read_csv('tasklist.csv') self.tasklist['Deadline'] = pd.to_datetime(self.tasklist['Deadline'])