🖥️ Developed using Microsoft Visual Studio Code¶
The automation files, used to prepare the virtual environment and run the scripts, are located in the .vscode folder.
File Descriptions¶
📄 File: tasks.json. 👉 Documented below: 🧭 Running Tasks
- task: PowerShell Create virtual environment
Once the Python version has been selected and installed, the disk path to python_bin is configured to create the virtual environment. Commands are executed in the samples root folder.
- task: PowerShell Delete Temporary Files:
venv/
tmp/
logs/
📄 File: launch.json. 👉 Documented below: 🐞 Running Launch Configurations
Once created in a virtual environment, from vscode, by clicking on a file, for example: scripts/python/sample_01_connection_status.py, proceed to use the "Run and Debug (Ctrl+Shift+D)" option, which executes <sample>.py using the virtual environment.
The script will be executed using the assigned virtual environment binary.
> .\venv\Scripts\python.exe ... <sample>.py
▶️ Execution modes¶
🧭 Running Tasks¶
⌨️ Keyboard method¶
- Press:
Ctrl + Shift + P (Windows / Linux)
Cmd + Shift + P (macOS) - Type:
Tasks: Run Task - Press Enter
- Select the task you want to run.
🖱️ Mouse method¶
- Open the menu:
View → Command Palette… - Type Tasks: Run Task
- Click on the option.
- Select the task from the list.
🐞 Running Launch Configurations (Run / Debug)¶
Launch configurations in .vscode/launch.json allow running or debugging Python scripts in a controlled way.
⌨️ Keyboard method¶
- F5 → Start debugging
- Ctrl + F5 → Run without debugging
To select another configuration:
- Press Ctrl + Shift + P
- Type: Debug: Select and Start Debugging
- Select the desired launch configuration.
🖱️ Mouse method¶
- Open the Run and Debug view (icon ▶️🐞).
- At the top, select the launch configuration from the dropdown menu.
- Click:
- ▶️ Run to execute
- ▶️🐞 Start Debugging to debug