I’m writing a program that connects to my website via ftp. If the login authentication fails, I want it to continue on to do something else. But an authentication failure error automatically exits the program. Is there a way to ignore this and continue on?
Share
You can use Python’s Exception Handling:
replace do_something() with code you first want to try.. Replace do_somthing_else() code with what you wish to try when do_something() part fails
Reference for Exception Handling