Everything’ i did to get vs code and wsl to work together for python :)
Every windows user should be using python in this way.
Step 1 : basics things
Step 2: Setting up wsl
- open Ubuntu terminal and set it up.
- run the following commands
sudo apt-get update && sudo apt-get upgrade
- to check for for python version
- install pip and pylint by
sudo apt install python3-pip
sudo apt-get install pylint
Step 3: Connecting things
- Open vs code and in the extensions tab
- search for “Remote-Wsl” and install it
Step 4: Initializing from Ubuntu
- open the Ubuntu terminal
- make sure you are in the home directory [ if not type “cd” and press enter ]
- make a folder and open it
- type “code .” and press enter.
This will open vs-code
you will see this symbol after vs code set up wsl
Step 5 : Finalizing…
- Make a new file, ex: “app.py”
- when you open the file, vs code prompts to install python extension, go for it.
- then vs code prompts for to select python interpreter, select the python 3 version
- vs code will then prompt you to install lint in the pop from down right
- click “select linter”
- and then from the drop down menu in the center menu, select pylint.
Congrats, you are all done now!!
Step 6: running your first program
- in the app.py write the code
- then press ctrl+`
- wsl pops up as terminal
- give the command python3 app.py and press enter.
You are done now
I hope you were successful :
Follow me on
Github : https://github.com/dev117uday