擅长:python、mysql、java
<p>您可以列出类中的所有方法和字段</p>
<pre><code>dir(IP)
</code></pre>
<p>但它没有给出细节</p>
<p>顺便说一句:您可以将它们作为任何其他列表进行筛选</p>
<pre><code>list(name for name in dir(IP) if 'raw' in name)
</code></pre>
<p>当你忘记了某个名字并想找到它时,它会很有用</p>
<hr/>
<p>您可以在代码中显示文档字符串中的信息</p>
<pre><code>help(IP)
help(IP.ihl)
</code></pre>
<p>它可以提供一些细节</p>
<hr/>
<p>最后,您可以在<a href="https://scapy.readthedocs.io/en/latest/index.html" rel="nofollow noreferrer">documentation</a>中搜索,并找到<a href="https://scapy.readthedocs.io/en/latest/api/scapy.layers.inet.html?highlight=IP#scapy.layers.inet.IP" rel="nofollow noreferrer">scapy.layers.inet.IP</a></p>
<hr/>
<p>但要理解某些领域,您可能需要简单地学习TPC/IP和其他只使用的协议——它并不决定协议是如何定义的</p>