I'm working with some software for which the names evolve. This means that if I'm using the awesome pywinauto, the names can be different. Depending on the generation I'm using, for example, I might have
app.Book1AlphaXL.set_focus()
app.Book1AlphaXL.Lists.click()
or
app.Book1BetaXL.set_focus()
app.Book1BetaXL.Lists.click()
Instead of an ever expanding big fat switch statement, I'd like to alter the Book*XL part in the code so that it could be set from a JSON input or command line argument. What could be the best approach there?
Should I spin up a function file on the fly which would handle this? (That could be written actually, but feels sick.) Is there some kind of {Param} functionality in Python I can use?