Understanding the Colorization of Code in VEXcode VR Python

When creating Text projects, the syntax, spacing, indenting, and spelling in your code in very important to ensure that your project runs as intended. The color coding present in the Workspace in VEXcode VR Python is an extra visual cue that you have entered your code into your project correctly.

If there is an unrecognizable component while typing commands into the Workspace, it will remain black (like the user-created category). This can be a useful indicator as you are working to prevent frustration or extra troubleshooting later on.

Use the cursor and keyboard to correct errors. As the components are recognized, they will be colorized correctly.

The colorization of code follows the following conventions:

Classes

VEXcode VR Python editor showing syntax colors for commands, variables, and comments

The individual device the command pertains to (i.e. drivetrain, pen, brain)

Commands

Project Help panel listing Python command categories with example syntax in VEXcode VR

The behavior within the command (i.e. drive, turn)

Parameters

Project Help example showing the [ ] placeholder for a required Python command parameter

Information about how the behavior executes (i.e. direction, distance)

Structures

VEXcode VR Python project with syntax highlighting for commands, numbers, and comments

Control the flow of the project (i.e. conditionals, loops)

Values

VEXcode VR Python syntax highlighting shows different colors for commands, numbers, and comments

Numerical parameter assigned to the behavior (i.e. number of degrees of a turn)

User Created

VEXcode VR Python editor showing syntax colors for commands, numbers, and comments alongside Help examples

User created variables and commands

Comments

Project Help panel showing Python syntax color examples in VEXcode VR

The text following a # that will not effect the program.

For more information, help, and tips, check out the many resources at VEX Professional Development Plus

Last Updated: