LoginSignup
10
8

More than 3 years have passed since last update.

VSCode + Python で, Jupyter notebook っぽいインラクティブ表示モードを使うメモ

Last updated at Posted at 2020-07-02

背景

  • Jupyter-lab で matplotlib などでプロットのインラクティブ表示などを使っているが, VSCode でも似たようなのがほしい
  • .ipynb で VSCode で notebook モードにする手ははあるが, vim キーバインドが使えずつらい :cry:
  • 素の .py ファイル/プロジェクトでインタラクティブプロット表示とかしてほしい

方法

Working with the Python Interactive window
https://code.visualstudio.com/docs/python/jupyter-support-py

Python ファイルを作成し, #%% と打つだけで, notebook っぽい interactive mode いけました!
(#%% には, スペースがあってもなくてもどちらでもかまいせん)

jupyter 関連インストールされていなければ, インストールしますかポップアップ出してくれます!

Screenshot from 2020-07-02 18-03-31.png

Cell とかは VSCode 側でアノテーション表示されているものです.

いろいろ設定するとインライン表示もできるかも?

macOS だと, python や jupyter addon のインストール関連で注意しないとうまくうごかないかもです!

TODO

  • remote Jupyter と接続などアドバイスな機能を調べる
10
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
8