The general logic is fine, but I would advise against bare "except:" statements. This will catch any and all exception, even those which would otherwise point out blatant errors in the code such as NameError, SyntaxError, or AttributeError. You can easily and silently break the complete try: block with that. I suggest to rather just except the classes that can realistically happen, and have it actually crash on an unexpected exception.
The general logic is fine, but I would advise against bare "except:" statements. This will catch any and all exception, even those which would otherwise point out blatant errors in the code such as NameError, SyntaxError, or AttributeError. You can easily and silently break the complete try: block with that. I suggest to rather just except the classes that can realistically happen, and have it actually crash on an unexpected exception.