I'm wanting to import a specific class via a choice thats made by the user. The following is the flawed code that I came up with (but doesn't 'compile' ...)
I would also like to remove the class if that is possible on demand as well.Code:def packageSelect(self, event, package): self.package_type = package import ("%s" % ("" + LIB_PATH + self.package_type + "_package.py")) return package
Truth be told I"ve never seen this done.
Does this help?
I just googled for 'python "conditional import"' and 'python dynamic import'