Starting, Downloading, and Running a Python Project in VEXcode EXP

Starting and downloading Python projects in VEXcode EXP is easy.


How to Start a Python Project

New Blocks project opened in VEXcode EXP.

Launch VEXcode EXP. The platform defaults to the Blocks interface.

VEXcode EXP Toolbar with the File menu open and the New Text Project option highlighted. New Text Project is the second option in the menu, below New Blocks Project.

Select ‘File,’ then ‘New Text Project’ to open the text interface.

VEXcode EXP Select a Project Language prompt that has options for Python or C++. Either language can be selected to open a new project, or below there is a Cancel button that will close the menu. The Python project option is highlighted.

Next, select the Python project language. There is the option to start a new project in either C++ or Python.

Note: Currently, only EXP electronics are compatible with Python projects.

New Python project opened in VEXcode EXP.

The Python interface will open.


How to Build a Python Project

This section will show you how to create a basic Python project using commands from the Tool Box. The project outlined here will drive the EXP BaseBot forward for 200 millimeters (mm).

VEXcode EXP Toolbar with the File menu open and the Open Examples option highlighted. Open Examples is the fifth option in the menu, below New Blocks Project, New Text Project, Open, and Open Recent.

Select ‘File’ then ‘Open Examples” to open a template project.

BaseBot Drivetrain 2 motor example project thumbnail.

Select the Basebot (Drivetrain 2-motor) template. Templates are blank projects with preset device configurations.

VEXcode EXP Unsaved Project prompt that reads Your project was never saved. Save now? There are two buttons below, one reads Discard and the other reads Save.

If your project was not saved, the 'Save now' window will appear before the Example Project opens in the workspace.

Select 'Save' if you you want to save your previous project, otherwise select 'Discard.'

VEXcode EXP with a template Example Project opened, including configured devices and code comments with a description of the project.

Notice that a set of project comments open in the workspace. You will add commands after the comments.

VEXcode EXP with the BaseBot Drivetrain 2 motor template Example Project opened. A specific blank line of code at line 42 is highlighted directly below the comment that reads Begin project code.

Select enter at the end of the last line of code (line 42). This should create the next numbered line (line 43). This is where you will start adding code to the project.

VEXcode EXP with the Drive for command highlighted in the Python Toolbox.

Now you can add commands from the Toolbox. Select the Drive for command.

VEXcode EXP with the BaseBot Drivetrain 2 motor template Example Project opened. The previously blank line of code now has a Drive for command in it that reads drivetrain.drive_for(FORWARD, 200, MM).

Drag the Drive for command into the workspace and place it on the last line of the project (line 43).


How to Download and Run a Python Project

VEXcode EXP Toolbar with the project name field highlighted and renamed to Drive Forward. To the right of the project name a label reads Saved.

First, name and save your Python project. View one of the following articles for detailed information on how to save a VEXcode EXP Python project:

VEXcode EXP with the Slots dropdown menu opened. There are 8 available slots for downloading projects to the Brain, and the first slot is highlighted.

Then, choose which of the Brain’s slots you will download the project to. To do this, select the ‘Slot’ button on the Toolbar.

VEXcode EXP Toolbar with the green Brain icon highlighted, indicating that the Brain is connected.

Next, connect the Brain to your device (Directly via Micro-USB, USB-C or via VEX Controller. View this section of the Knowledge Base to learn more about connecting an EXP Brain to VEXcode EXP) and check that the Brain icon is green.

VEXcode EXP Toolbar with the Download icon highlighted in between the Brain and Run icons.

Select the ‘Download’ button to download the project to the Brain. The project will download to the chosen slot.

VEXcode EXP Toolbar with the Run icon highlighted in between the Download and Stop icons.

Finally, select ‘Run’ to start the project while the robot is still connected to your computer.

VEXcode EXP Brain screen is shown with the Drive Forward project's options opened and the Run button selected.

Or, disconnect the Brain from your device and run the project on the EXP Brain.

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

Last Updated: