How do I get all the classes in a module? For example if a module has classes A, B and C, how do I get the names of all these classes through code?
Asked
Active
Viewed 114 times
1 Answers
0
Try this:
import importlib, inspect
inspect.getmembers(
importlib.import_module("your_module"),
inspect.isclass
)
this will give you what you are looking for.

Mehrdad Pedramfar
- 10,941
- 4
- 38
- 59