我想用scapy来制作数据包。在查看IP()类成员时,我遇到了以下代码习惯用法:
'fieldtype': {
'frag': <Field (IP,IPerror).frag>,
'src': <Field (IP,IPerror).src>,
'proto': <Field (IP,IPerror).proto>,
'tos': <Field (IP,IPerror).tos>,
'dst': <Field (IP,IPerror).dst>,
'chksum': <Field (IP,IPerror).chksum>,
'len': <Field (IP,IPerror).len>,
'options': <Field (IP,IPerror).options>,
'version': <Field (IP,IPerror).version>,
'flags': <Field (IP,IPerror).flags>,
'ihl': <Field (IP,IPerror).ihl>,
'ttl': <Field (IP,IPerror).ttl>,
'id': <Field (IP,IPerror).id>},
'time': 1465637588.477862,
'initialized': 1,
'overloaded_fields': {},
我对Python比较陌生。有人能解释一下尖括号在每个字段类型定义中的作用吗?在
我一直试图用下面的文档来解决这个问题,但是完全卡住了。在
谢谢
当应用于
Field
实例时,repr
使用以下定义来表示__repr__
,这是not Python语法的来源。在相关问题 更多 >
编程相关推荐