3
我想用scapy来制作数据包。当通过IP()类成员浏览时,我遇到以下代码成语:Python中的尖括号
'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相对来说比较新。有人能向我解释尖括号在每个字段类型定义中的用途吗?
我一直在试图找出这个自己使用下面的文档,但完全卡住了。
由于
它只是对象的字符串表示形式,而不是实际的Python语法。 –