Python: How to get defined classes list from module (*.py file)

The list of classes defined in the * .py file can be obtained using the built-in module “inspect”.

For example, for the “test_cls” module:

we can get a list of classes with the following code:

 

0 0 votes
Article Rating
Subscribe
Notify of
0 Комментарий
Inline Feedbacks
View all comments