st.write("Total score : ",total_score,"%") st.write("Result : ",Result) st.write("Grade : ",Grade) if data['total_score'][0] >=85: st.success("**Congratulations! Keep going!!! Best of luck!!**") elif data['total_score'][0] >=50 and data['total_score'][0] < 85: st.success("**Nice! You can still do better. Best of luck!!**") else: st.warning("**Woops!!! You need to work hard. Don't loose hope and keep working hard. Best of luck!!**") sm = SendMail.Mail(name_ip, roll_no_ip, total_score, Result, Grade, email_ip) sm.send_mail() with st.spinner('!!Mail sent to given email address!!'): time.sleep(2) list_1 = [[roll_no_ip, name_ip, email_ip, gender_ip, p_level_ip, lunch_ip, test_prep_ip, math_ip, read_ip, write_ip, total_score, Grade, Result]] data_1 = pd.DataFrame(list_1, columns = ['Roll No.','Name','Parent\'s Email ID','Gender', 'Parental Level of Education', 'Lunch', 'Test Preparation Course', 'Maths Score', 'Reading Score', 'Writing Score', 'Total Score', 'Grade', 'Result']) if os.path.exists(path+'/Data/Student_data.xlsx'): wb = load_workbook(path+'/Data/Student_data.xlsx') sheet = wb.active for row in list_1: