如何阅读某些模块的文档?

问题描述 投票:0回答:1

我刚刚完成了Python的学习,​​所以现在我可以键入自己的脚本了。为此,我开始使用Scapy模块编写脚本,但是问题是,Scapy的文档用于解释器Scapy,所以我不知道如何使用它,找不到函数,等等。] >

我在Internet上发现了几本带有少量示例的教程,但这很难。例如,我在脚本中找到了函数“ set_payload”以在该层中注入一些代码,但我真的不知道他在哪里找到了该函数。

您对发现模块如何工作,如何正确编写模块有何建议?因为我不太喜欢在Internet上检查和选择其他脚本。

PS:对不起,我的英语,比说我更好理解。如果您不理解我的问题,我可以尝试重新制定它。谢谢:)

我刚刚完成了Python的学习,​​所以现在我可以键入自己的脚本了。为此,我开始使用Scapy模块编写脚本,但问题是,Scapy的文档用于...

python function module documentation scapy
1个回答
0
投票

对于大多数模块,您可以使用__doc__。例如,>

import pandas as pd


print(pd.__doc__)

pandas - a powerful data analysis and manipulation library for Python
=====================================================================
**pandas** is a Python package providing fast, flexible, and expressive data
structures designed to make working with "relational" or "labeled" data both
easy and intuitive. It aims to be the fundamental high-level building block for
doing practical, **real world** data analysis in Python. Additionally, it has
the broader goal of becoming **the most powerful and flexible open source data
analysis / manipulation tool available in any language**. It is already well on
its way toward this goal.
Main Features
-------------
Here are just a few of the things that pandas does well:
  - Easy handling of missing data in floating point as well as non-floating
    point data.
  - Size mutability: columns can be inserted and deleted from DataFrame and
    higher dimensional objects
  - Automatic and explicit data alignment: objects can be explicitly aligned
    to a set of labels, or the user can simply ignore the labels and let
    `Series`, `DataFrame`, etc. automatically align the data for you in
    computations.
  - Powerful, flexible group by functionality to perform split-apply-combine
    operations on data sets, for both aggregating and transforming data.
  - Make it easy to convert ragged, differently-indexed data in other Python
    and NumPy data structures into DataFrame objects.
  - Intelligent label-based slicing, fancy indexing, and subsetting of large
    data sets.
  - Intuitive merging and joining data sets.
  - Flexible reshaping and pivoting of data sets.
  - Hierarchical labeling of axes (possible to have multiple labels per tick).
  - Robust IO tools for loading data from flat files (CSV and delimited),
    Excel files, databases, and saving/loading data from the ultrafast HDF5
    format.
  - Time series-specific functionality: date range generation and frequency
    conversion, moving window statistics, moving window linear regressions,
    date shifting and lagging, etc.
© www.soinside.com 2019 - 2024. All rights reserved.