相关疑难解决方法(0)

Python中的尖括号

我想使用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': {},
Run Code Online (Sandbox Code Playgroud)

我对Python比较陌生。有人可以向我解释尖括号在每种字段类型定义中的作用是什么?

我一直在尝试使用以下文档自己弄清楚这一点,但完全被卡住了。

Scapy 2.3.1

谢谢

python scapy

5
推荐指数
1
解决办法
2036
查看次数

标签 统计

python ×1

scapy ×1