JupyterNotebookでPython実行環境を作ってHelloWorld !
目次
Jupyter Notebookとは
「Jupyter Notebook」は、PythonなどをWebブラウザ上で記述・実行できる統合開発環境。
ただしインターネット上のどこかのサーバーにPythonのファイルが置かれるわけではない。
Pythonファイルやライブラリはあくまで自分のPCの中にある。
単にブラウザ上に表示させるだけ。ブラウザでもテキストファイルみれるでしょ?
Anacondaとは
Pythonの豊富な機械学習系ライブラリ付きのJupyter Notebookのこと。こっちをインストールすればJupyter Notebookもついてくる。
Jupyter Notebook with Anaconda のインストール
Anaconda公式HPへアクセス。
Windows, Mac, Linux用のインストーラーがある。インストーラーで普通にインストール。
デフォルトのまま従えばいい。

Jupyter Notebookを立ち上げ
立ち上げは、Windowsキー(田)→ Jupyter Notebook (anaconda3)

すると黒端末(Terminal)が立ち上がり、何やらメッセージが出てくるが気にしない。

しばらく待っていると、ブラウザが立ち上がる。
ブラウザ上のフォルダはそのパソコンの
C:\Users\UserName
を示している。

作業フォルダ作成
例として、ここの直下に/JupitorNotebook フォルダを作成してその中を作業フォルダにする。


↓

/JupitorNotebook フォルダに入る。

サンプルソース作成

別のブラウザが立ち上がり、「Untitled.ipynb」というファイルができる。

別に立ち上がったブラウザ

上の方のファイル名を押せば、ファイル名を変えられる。

HelloWorldプログラム実行
以下のように打ち込み、「▶RUN」か「Shift + Enter」を押せば行内実行できる!

これでPython環境が出来上がりました!まるでMatLabのようです。