
- Jupyter 教程
- Jupyter - 首頁
- IPython
- IPython - 簡介
- IPython - 安裝
- IPython - 開始使用
- 執行和編輯 Python 指令碼
- IPython - 歷史命令
- IPython - 系統命令
- IPython - 命令列選項
- 動態物件自省
- IPython - I/O 快取
- 將 IPython 設定為預設 Python 環境
- 匯入 Python Shell 程式碼
- IPython - 嵌入 IPython
- IPython - 魔術命令
- Jupyter
- Jupyter 專案 - 概述
- Jupyter Notebook - 簡介
- 線上使用 Jupyter
- 安裝和開始使用
- Jupyter Notebook - 儀表盤
- Jupyter Notebook - 使用者介面
- Jupyter Notebook - 單元格型別
- Jupyter Notebook - 編輯
- Jupyter Notebook - Markdown 單元格
- 單元格魔法函式
- Jupyter Notebook - 繪圖
- 轉換 Notebook
- Jupyter Notebook - IPyWidgets
- QtConsole
- QtConsole - 開始使用
- QtConsole - 多行編輯
- QtConsole - 內聯圖形
- QtConsole - 儲存為 Html
- QtConsole - 多個控制檯
- 連線到 Jupyter Notebook
- 使用 github 和 nbviewer
- Jupyter 資源
- Jupyter - 快速指南
- Jupyter - 有用資源
- Jupyter - 討論
IPython - 動態物件自省
IPython 提供了多種方法來動態獲取有關 Python 物件的資訊。在本章中,讓我們學習在 IPython 中進行動態物件自省的方法。
使用? 和 ?? 可以提供關於物件的具體和更詳細的資訊。在下面討論的第一個示例中,建立了一個簡單的整數物件 a。可以透過在輸入單元格中鍵入 a ? 來獲取其資訊。

在第二個示例中,讓我們定義一個函式,並使用? 和 ?? 來自省此函式物件。

請注意,魔法函式%psearch 等效於使用? 或 ?? 獲取物件資訊。
廣告