Answers for "python get class properties"

0

python get attributes of class

import inspect

class myclass:
  a = 5
  def method(b):
    return b

for i in inspect.getmembers(myclass):
  print(i)
Posted by: Guest on February-22-2021
1

python get object class

user = User()
type(user).__name__
>> 'User'
Posted by: Guest on May-07-2021

Code answers related to "python get class properties"

Python Answers by Framework

Browse Popular Code Answers by Language