Skip to content

Instantly share code, notes, and snippets.

@cgebbe
Last active April 13, 2022 17:08
Show Gist options
  • Save cgebbe/7071492c47d1038bc5c7a1c8bc46d7f9 to your computer and use it in GitHub Desktop.
Save cgebbe/7071492c47d1038bc5c7a1c8bc46d7f9 to your computer and use it in GitHub Desktop.
Setup vscode live share

Install Visual Studio Code (VS Code)

https://code.visualstudio.com/

Select your python interpreter

  • Open the "show all commands" bar by hitting "F1" or "Ctrl+P"
  • select some interpreter of your system (preferrably in a python environment)

You should now be able to run python programs

  • create a new file "dummy.py"
  • write 'print("hello world")' or similar to it
  • Press F5 to run the file

Open the exercise folder in VS Code

  • download the "exercises.zip" folder for the current class from google classroom
  • Open visual studio code
  • Go to menu bar > File > Open Folder

Configure pytest

  • Open the "show all commands" bar by hitting "F1"
  • enter "configure tests"
  • select "Python: Configure Tests"
  • select pytest
  • select the exercise directory

When you open e.g. "test_ex1.py" now, you should see green triangles next to the tests:

  • right click on them and select either "debug" or "run" or "reveal in test explorer"

Activate VS Code live share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment