How does one convert a string to the name of a class in Python? For example, if I have a series of related classes such as MyClass1
, MyClass2
, MyClassN...
, how do I call the class I need if I were in a conditional assuming only the ending number of the string were to change?
Edit: All the classes are already defined. I just need a way to call them depending on the situation. The number will be coming from a GET variable so it would be nice if I can just append that number to a string.