class dictObj(object):  
     def __init__(self):  
         self.x = 'red'  
         self.y = 'Yellow'  
         self.z = 'Green'  
     def do_nothing(self):  
         pass  
test = dictObj()  
print(test.__dict__)

  

相关文章:

  • 2022-12-23
  • 2021-10-22
  • 2022-12-23
  • 2021-10-11
  • 2021-07-06
  • 2022-12-23
  • 2021-08-17
猜你喜欢
  • 2021-11-27
  • 2021-09-20
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2022-12-23
相关资源
相似解决方案