Setup VS Code

Install and configure VS Code for code editing.

This guide explains the steps to set up VS Code after installing the Anaconda environment scopefoundry, as described here.

Steps to Set Up VS Code

  1. Install Visual Studio Code.

  2. Install Extensions:

    1. Python (Microsoft)

    2. Pylance (Microsoft)
      Optional, but recommended:

      • Jupyter (Microsoft)

      • h5web

      • see picture.

      vs-code-extensions

  3. File -> Open Folder… to open your_project_folder.

  4. Select the Python Interpreter:

    • Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on macOS).
    • Search for and select “Python: Select Interpreter”.
    • Choose the interpreter associated with the scopefoundry environment.

    or

    • select on the bottom right:

      vs-code-select-interpreter

  5. Run a Python File (e.g., fancy_app.py):

    1. Open and select the file you want to run, such as fancy_app.py.
    2. Press F5 or go to Run > Start Debugging.
    3. If prompted:
      • Select Python Debugger.
        vs-code-run
      • Select Python File.
      • Press the blue button labeled “Debug and Run”.
  6. Verify the App Runs:

    • The app should now execute successfully.

Next