您将需要在辅助函数中返回值并从主send_email()
函数中调用这些函数,并将返回的值分配给变量。像这样:
def get_email_address():
#the code to open up a window that gets the email address
Email = input
return Email
def get_email_username():
#the code to open up a window that gets email username
Email_Username = input
return Email_Username
#same for the email recipient and email password
def send_email():
# variables from the other def's
email_address = get_email_address()
email_username = get_email_username()
#code to send email