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:

 

4 1 vote
Article Rating
Subscribe
Notify of
0 Комментарий
Newest
Oldest Most Voted
Inline Feedbacks
View all comments