Everything’ i did to get vs code and wsl to work together for python :)

Every windows user should be using python in this way.

Just logos
Just logos

Step 1 : basics things

  • Install vs code from here.
  • Install any Linux distro, ex : ubuntu, from Microsoft store
  • 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
python3 --version
  • install pip and pylint by
sudo apt install python3-pip
sudo apt-get install pylint
  • Open vs code and in the extensions tab
Image for post
Image for post
  • search for “Remote-Wsl” and install it
Image for post
Image for post

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
mkdir python_proj
cd python_proj
  • type “code .” and press enter.

This will open vs-code

Image for post
Image for post

you will see this symbol after vs code set up wsl

  • 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
Image for post
Image for post
  • 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

print(“Hello world”)

  • 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

Linkedin : https://www.linkedin.com/in/uday-yadav-4995a818a

Sophomore && CSE Undergrad

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store