- Jupyter 教程
- Jupyter - 首頁
- IPython
- IPython - 簡介
- IPython - 安裝
- IPython - 入門
- 執行和編輯 Python 指令碼
- IPython - 歷史命令
- IPython - 系統命令
- IPython - 命令列選項
- 動態物件自省
- IPython - I/O 快取
- 將 IPython 設定為預設 Python 環境
- 匯入 Python Shell 程式碼
- IPython - 嵌入 IPython
- IPython - 魔法命令
- Jupyter
- Project Jupyter - 概述
- Jupyter Notebook - 簡介
- 使用線上 Jupyter
- 安裝和入門
- Jupyter Notebook - 儀表盤
- Jupyter Notebook - 使用者介面
- Jupyter Notebook - 單元格型別
- Jupyter Notebook - 編輯
- Jupyter Notebook - Markdown 單元格
- 單元格魔法函式
- Jupyter Notebook - 繪圖
- 轉換筆記本
- Jupyter Notebook - IPyWidgets
- QtConsole
- QtConsole - 入門
- QtConsole - 多行編輯
- QtConsole - 內聯圖形
- QtConsole - 儲存為 Html
- QtConsole - 多個控制檯
- 連線到 Jupyter Notebook
- 使用 github 和 nbviewer
- JupyterLab
- JupyterLab - 概述
- 安裝和入門
- JupyterLab - 介面
- JupyterLab - 安裝 R 核心
- Jupyter 資源
- Jupyter - 快速指南
- Jupyter - 有用資源
- Jupyter - 討論
IPython - 匯入 Python Shell 程式碼
IPython 可以從標準 Python 控制檯讀取,預設提示符為>>>,以及另一個 IPython 會話。以下螢幕截圖顯示了在標準 Python shell 中編寫的 for 迴圈 -
複製程式碼(以及 Python 提示符)並將程式碼貼上到 IPython 輸入單元格中。IPython 會智慧地過濾掉輸入提示符(>>> 和 ...)或 IPython 提示符(In [N]: 和 ...:)
類似地,可以將來自一個 IPython 會話的程式碼貼上到另一個 IPython 會話中。下面給出的第一個螢幕截圖顯示了一個 IPython 視窗中 SayHello() 函式的定義 -
現在,讓我們選擇程式碼並將其貼上到另一個 IPython shell 中並呼叫 SayHello() 函式。
廣告