Python

用VScode來一小段python - Jupyter

有時候想驗證function 邏輯, 又不想開一個 py file
這時候想到 ipython, 但! 人就是這麼懶.. 連terminal 也很不想打字?
那麼 Jupyter 就是你和 python 的邱比特
先安裝吧 (如果有用虛擬環境, 建立一個給jupyter吧)
pip install jupyter
VScode 使用 Jupyter
Ctrl + shift + P -> 打上 Jupyter 選擇 Jupyter: Create New Blank Notebook
YES! 開始 建立你的 python 筆記吧
幾個好用快速鍵
Alt + Enter 執行這個cell, 執行後再幫你多一個cell
Shift + Enter 執行這個cell, 執行後再幫你選下一個cell
Ctrl + Enter 只有執行這個cell, 不會雞婆了
K 往上選一個cell
J 往下選一個cell
A 往上建立一個cell
B 往下建立一個cell
D,D 喜歡 VIM 的, 你懂的
L 顯示行數 (要先選擇有程式碼的cell喔)
comments powered by Disqus