I have some python code where I can accept two different file names, so I would like to do something like try the first file name, if there is an exception then try the second filename, if the second try fails, then raise the exception and handle the error.
So the basic logic is:
first try this: f = file(name1) if not, then try this f = file(name2) else error() I'm pretty sure I could do this with nested try/except blocks, but that doesn't seem like a good solution. Also, if I want to scale up to something like 20 different filenames, then nesting the try/except blocks would get really messy.
Thanks!