Apr-22-2020, 09:20 PM
The string formatting I specify in python doesn't carry over perfectly to email when I send it via smtplib.
[attachment=844]
Which as you can see is a bit off in its formatting
def main(): pull() # pulls html grades from university website graded_courses = scrape() # scrapes html row_fmt = '{0:10}{1:4}{2:6}{3}\n' body = "" for course in graded_courses: body += row_fmt.format(course.name, 'f'+course.percentage_grade, course.letter_grade, 'g'+course.avg) #grades are not released yet, so 'f' and 'g' are just for demo purposes (course.percentage_grade, course.avg are empty strings) print(body) send_email(body)
Output:CSC148H1 f IPR g
CSC165H1 f IPR g
MAT137Y1 f IPR g
MAT224H1 f IPR g
SMC212H1 f IPR g
Email sent
However my gmail display shows this:[attachment=844]
Which as you can see is a bit off in its formatting