VScodeでプログラミング。
VScodeを使う利点は?
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
さて今回は番長視点。ほんっとに素人視点での話にゃよ。
![](https://nekopom.jp/wp-content/uploads/2023/05/pipoko.png)
![](https://nekopom.jp/wp-content/uploads/2023/05/pipoko.png)
![](https://nekopom.jp/wp-content/uploads/2023/05/pipoko.png)
たぶん、できる人からのVScodeの良さは素晴らしい意見がいっぱいあるとおもいます。でも、素人のよくわかってない人からの意見も大切。そもそも番長はPython自体もよくわかってないのでそういう視点からのお話です!
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
Windowsのメモ帳ようなラズパイのテキストエディタでもラズパイでPythonプログラミングできるにゃよ。でもテキストエディタからはpythonの実行はできません。テキストエディタに書いてターミナルから実行しなきゃになっちゃう。もっと楽ちんにプログラム書いて実行したい。
![](https://nekopom.jp/wp-content/uploads/2023/05/pipoko.png)
![](https://nekopom.jp/wp-content/uploads/2023/05/pipoko.png)
![](https://nekopom.jp/wp-content/uploads/2023/05/pipoko.png)
書いて即実行できるのはラズパイ付属のThonnyを使うことになるんだけど、短いプログラムはThonnyで全然十分なのですが、素人はプログラムを簡略化するのがむずかしいし、自分でわかりやすく書いちゃうためにプログラムが長くなりがちですね。
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
VScodeだとコードが長くなっちゃっても折りたたむことができるし、print という命令ひとつとっても pと入力するだけでprint,pass,powとか候補が出てくる便利さ。
![](https://nekopom.jp/wp-content/uploads/2023/05/pipoko.png)
![](https://nekopom.jp/wp-content/uploads/2023/05/pipoko.png)
![](https://nekopom.jp/wp-content/uploads/2023/05/pipoko.png)
単純に便利さは、テキストエディタ<Thonny<VScode。もちろん重さもテキストエディタ<Thonny<VScode。ですね…。
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
正直3BじゃVScodeは重い。4Bじゃないと重いかなー
![](https://nekopom.jp/wp-content/uploads/2023/05/pipoko.png)
![](https://nekopom.jp/wp-content/uploads/2023/05/pipoko.png)
![](https://nekopom.jp/wp-content/uploads/2023/05/pipoko.png)
でもなんといっても….VScodeは見た目がいいんです!!
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
見た目重要。
![](https://nekopom.jp/wp-content/uploads/2023/05/pipoko.png)
![](https://nekopom.jp/wp-content/uploads/2023/05/pipoko.png)
![](https://nekopom.jp/wp-content/uploads/2023/05/pipoko.png)
作成してセットアップしたSDカードは3A+、3B、4Bで動かせますので、インストールして準備だけしといてもあとで便利だと思いますよー。
VScodeをインストールする
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
タスクバーからターミナル起動して sudo apt install code にゃ。
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-command-code.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-command-code.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-command-code2.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-command-code2.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
インストール完了したら、スタートメニューからCisual Studio Codeを起動するにゃよ。
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-command-code3.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-command-code3.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
起動したらテーマが選択できるにゃね。
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup1-1024x824.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup1-1024x824.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
下の例は「See More Themes」を押して 番長の趣味にしたにゃ。もちろんみなさんの好きなテーマ選ぶにゃ!
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup2B-1.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup2B-1.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup3.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup3.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
日本語にするにゃよ。Extensions アイコンを押します。
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup7B.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup7B.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
いっぱい出てきて探すのめんどうなのでここで「日本語」と入力。Japanese Language Pack をインストール。
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup8b.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup8b.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup9.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup9.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
インストールが終了すると反映するには再起動せよ!とかウインドウでるのでVScodeを再起動にゃ。
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup10.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup10.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup11.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup11.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
無事日本語で起動されたにゃ。Pythonを使えるプラグインだけインストするにゃよ。検索窓にPythonと入力、出てきた一覧から「Python」をインストールします。
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup13B-1024x790.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup13B-1024x790.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup15.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup15.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
少し時間かかるかにゃ。終わったら一回「ようこそ」とか全て閉じてすっきりさせといいにゃね。
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup18.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup18.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
次はプログラミング遊び用フォルダを作って、そこをVScodeから簡単に覗けるようにするにゃよ。普通のファイルマネージャーを開いて新しいフォルダ作成。
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup19-1024x850.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup19-1024x850.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup21.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup21.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup20.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup20.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
VScodeのエクスプローラーアイコンを押して今つくったフォルダを開くにゃ。
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup33.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup33.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup24-1024x803.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup24-1024x803.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
信頼っ!
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup25.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup25.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
これでおっけーにゃ! VScodeのProgrammingフォルダに新規Pythonファイルを試しに作ってみようにゃ。
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup26-1.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup26-1.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup27.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup27.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
できたにゃ! ここにいろいろプログラミングしていけるにゃ。ちなみに、エクスプローラーアイコンを押すとフォルダ内一覧は隠れるにゃよ。
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup28-1.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup28-1.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup29.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup29.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/05/pipoko.png)
![](https://nekopom.jp/wp-content/uploads/2023/05/pipoko.png)
![](https://nekopom.jp/wp-content/uploads/2023/05/pipoko.png)
ファイルマネージャーを見るとちゃんとtest.pyできてるね!
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup30-1024x840.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup30-1024x840.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
![](https://nekopom.jp/wp-content/uploads/2023/06/nekoppi.png)
今回の作業をしていて、重いなーと思ったらラズパイ4を使うか、Thonnyを使うかにしたほうが良いとおもうにゃ。
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup32.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup32.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup31-1024x657.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/06/raspberrypi-VScode-setup31-1024x657.jpg)
![](https://nekopom.jp/wp-content/uploads/2023/05/pipoko.png)
![](https://nekopom.jp/wp-content/uploads/2023/05/pipoko.png)
![](https://nekopom.jp/wp-content/uploads/2023/05/pipoko.png)
こっちはVScodeほどの性能はないけど、軽い!! こっちもいいね!