Jupyter notebookを使ってPythonの練習をしてみます
#2. Jupyter Notebookを使ってPythonの基本を確認する
-githubのPythonの練習サンプルを開き、画面右上の緑の「Download ZIP」ボタンを押してzipファイルをダウンロードします

- Python3.6を使用するなどPython実行に仮想環境(virtualenvなど)を使用している場合、まだactivateしていない(
(xx)
プロンプトが表示されていない)場合、source xx/bin/activate
でPython実行用仮想環境をactivateします。プロンプトに(xx)
が表示されます
Python実行用仮想環境をactivateする
MacBook-Pro:tftest tohru$ source py3/bin/activate
(py3) MacBook-Pro:tftest tohru$
-
jupyter notebook
と入力し、jupyter notebookを起動させます。 - jupyterを未インストールの場合、Python2.x 環境であれば
pip install jupyter
で、Python3.x環境であればpip3 install jupyter
ででインストールします
(py3) MacBook-Pro:Python_basic tohru$ ls
Python_basic.ipynb
(tf) MacBook-Pro:Python_basic tohru$ jupyter notebook
- Jupyter notebookのメニューが表示されるので、「Python_basic.ipynb」を選択して実行します。


- このjupyter notebookの内容はhttps://github.com/eggplnt/python_basic/blob/master/python_basic/Python_Basic.ipynbで確認できます