I am developing a Python model that will support graphing if the correct modules are installed. I would like the source code to be the same if possible, IE, if the graphing model can’t load, graphing would be ignored from the menu logic.
How can I accomplish this?
Attempt an import and set a flag if fails. Then use the flag to determine whether to offer graphic output: