class LogEvent:
bus_seq = None
line_number = None
event_received_time = None
app_name = None
source_module_name = None
source = None
filename = None
message = None
serial_id = None
thread_id = None
log_event=LogEvent()
print(dir(log_event))
log_event.bus_seq='1111'
print(log_event.bus_seq)
[root@master tmp]# python a3.py
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'app_name', 'bus_seq', 'event_received_time', 'filename', 'line_number', 'message', 'serial_id', 'source', 'source_module_name', 'thread_id']
1111文章来源地址https://www.toymoban.com/news/detail-471744.html
文章来源:https://www.toymoban.com/news/detail-471744.html
到了这里,关于python 定义数据结构的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!