Project Workspace

Structure

When you use VSC to create an empty project, your project’s directory structure will look like the following.

.
├── .gitignore
├── .vscode
│   ├── settings.json
│   └── vex_project_settings.json
└── src
    └── main.py

Here are some basic information about the folders.

  • .vscode: Stores metadata.

  • src: Stores your code.

.vscode

The .vscode folder is very important; do not delete this folder and, in fact, version control this folder. This folder stores important metadata for your project. Namely, in this folder, there should be 2 files.

  • settings.json

  • vex_project_settings.json

The settings.json file stores settings information for VSC. The most important information in this file is the value pointed to by the field python.analysis.stubPath. This path points to a Python file that has stub code for VSC intellisense; without it, you will be coding blind.

{
    "python.analysis.stubPath": "c:/Users/user/AppData/Roaming/Code/User/globalStorage/vexrobotics.vexcode/sdk/python/EXP/EXP_1_0_0_8/vexexp/stubs",
    "python.analysis.diagnosticMode": "workspace",
    "python.analysis.typeCheckingMode": "basic"
}

The vex_project_settings.json file stores project information. Make sure your project’s platform matches the VEX robot (eg a mismatch will cause a failure to download the code to the VEX brain).

{
	"extension": {
		"version": "0.3.0",
		"json": 1
	},
	"project": {
		"name": "hello-world",
		"description": "",
		"creationDate": "1/12/2023, 4:35:03 PM",
		"platform": "EXP",
		"language": "python",
		"slot": 1,
		"sdkVersion": "EXP_1_0_0_8",
		"python": {
			"main": "src/main.py"
		}
	}
}