Category : error-handling

I’m trying to send an email using smtplib without storing smtp credentials locally. I found this article https://www.tutorialspoint.com/python/python_sending_email.htm but get an error. I’ve fairly new with smtplib. Any help would be appreciated. #!/usr/bin/python import smtplib message = """From: From Person <[email protected]> To: To Person <[email protected]> MIME-Version: 1.0 Content-type: text/html Subject: SMTP HTML e-mail test This ..

Read more

I keep getting the error: line 16, in <module> gradebook.remove[2](85) type error: ‘built_in_function_or_method’ object is not subscriptable. I don’t know what I am doing wrong… can anyone please help me. My code is as below: last_semester_gradebook = [["politics", 80], ["latin", 96], ["dance", 97], ["architecture", 65]] # Your code below: subjects = ["physics", "calculus", "poetry", "history"] ..

Read more

I try to raise an error without or a shorted path. def stringtester(integer): if type(integer) != int: raise ValueError("this is not a integer and I only like integers!") else: print("this is a integer and I like integers!") stringtester("this is a string") logicically it raise an error Traceback (most recent call last): File "C:/Users/user/Python/test.py", line 7, ..

Read more