Hello fellow coders!
Today I encountered a small difficulty while working with files.As a common
pratice, I want my function to check user's input(in this case it's file
name) and re-ask it again and again(until correct) offering him two
choices: re-enter file name or close program.I've decided to use try/except
construction in this particular task. After a bit of googling, I still
didn't figure out how and if it's possible to re-run code in try part again
if exception raises. Should I use try/except or you would recommend me
another way(god bless, we have plenty of them! :))? What are the pros&cons
of this method?

BTW, I created a small gist located here
<https://gist.github.com/bca59570ea5fd365c672> which demonstrates my
problem.

Thank you in advance for your help!
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to