I am trying to wait for user input. If no user input is provided then break. I found this code useful, but the problem is that it will continue if there was no user input provided. Is there something else I can add to make it break instead of continue?
The use case
I am sending a test email to myself. if the test email looks good I will send the email to the targeted people. I have two functions, one for the test and one for the real email. and between them, I need a break in case the test email has a problem.
import select
import sys
print('Press enter to continue.', end='', flush=True)
r, w, x = select.select([sys.stdin], [], [], 600)
print("the code will keep going after 600 seconds pass")