import C++ module, if fail: import Python version?
Question: I have a Python pyd module written in C++. I also have a Python version of the
module (which is much slower). My question is, as I want the program to run on
multiple OSs, can I try to import the C++ version in the program and import
the slower Python version if that one fails (other OS, architecture)?


Answer: Yes, you can import some thing like this:

    
    
    try:
        import CppModule as Module
    except ImportError:
        import PurePythonModule as Module
    

