【发布时间】:2021-11-19 15:00:30
【问题描述】:
我想了解在发生错误时如何返回或重复设置的代码。
例如:
import smtpd
LoginE = input("What is the email you will be using? \n")
LoginP = input("what is the password of the email you will using? \n")
server = smtplib.SMTP_SSL("smtp.gmail.com", 465)
server.login( LoginE , LoginP)
我尝试使用 try 函数,但它仍然会崩溃并告诉我有错误。
【问题讨论】:
-
是否您尝试使用
try?因为它不在您实际发布的内容中。 docs.python.org/3/tutorial/errors.html 解释了如何处理错误。 -
这能回答你的问题吗? While loop user input?
标签: python