• VEXcode Robotics Logo VEX Robotics Logo
  • VEX API Home Button VEX API Home Button
  • VEX 123 logo in purple VEX 123 logo in white
  • VEX GO logo in lime green VEX GO logo in white
  • VEXcode AIM logo in blue VEXcode AIM logo in white
  • VEX IQ logo in blue VEX IQ logo in white
  • VEX EXP logo in red VEX EXP logo in white
  • VEX V5 logo in red VEX V5 logo in white
  • VEX CTE logo in green VEX CTE logo in white
  • VEXcode VR logo in gold VEXcode VR logo in white
Skip to main content
Ctrl+K

< Back to Platform Select

  • VEX EXP
  • Python
  • Print Console
  • VEXcode Robotics Logo

Section Navigation

  • Blocks
  • Switch
  • Python
    • Enums
    • Accelerometer
    • AddressableLed
    • AiVision
    • AnalogIn
    • Arm
    • Brain
    • Bumper
    • Color
    • Competition
    • Controller
    • DigitalIn
    • DigitalOut
    • Distance
    • DriveTrain
    • Electromagnet
    • Encoder
    • Event
    • Gyro
    • Inertial
    • Led
    • Light
    • Limit
    • Line
    • MessageLink
    • Motor
    • Motor29
    • MotorGroup
    • MotorVictor
    • ObjectDetector
    • Optical
    • Pneumatic
    • Potentiometer
    • PotentiometerV2
    • Print Console
    • Pwm
    • Rotation
    • SerialLink
    • Servo
    • SignalTower
    • SmartDrive
    • Sonar
    • Thread
    • Triport
    • Vision
  • C++

Platform Navigation

  • VEX 123 logo in purple VEX 123 logo in white
  • VEX GO logo in lime green VEX GO logo in white
  • VEXcode AIM logo in blue VEXcode AIM logo in white
  • VEX IQ logo in blue VEX IQ logo in white
  • VEX EXP logo in red VEX EXP logo in white
  • VEX V5 logo in red VEX V5 logo in white
  • VEX CTE logo in green VEX CTE logo in white
  • VEXcode VR logo in gold VEXcode VR logo in white

Print Console#

  • Commands

    • Print to the Print Console

      • Format

      • New Lines

      • Different Colors

    • Clear the Print Console

Print Console commands are only available when using VEXcode EXP. If you are coding in VS Code, you will need to print to the V5’s Brain Screen using brain.screen commands.

All new projects begin with the cursor at row 1 in the Print Console.

Commands#

Print to the Print Console#

The print(text, end) method prints text on the screen using the current cursor position.

Parameters

Description

text

The string to print to the Print Console.

end

Whether or not to go to the Print Console’s next line. By default this is empty.

Format#

Values being printed to the Print Console can use the Python format method.

Some commonly used formatting types are:

  • d - Decimal Integer

  • f - Floating Point Number

  • o - Octal Integer

  • s - String

In order to use a formatting type, put the desired formatting type in curly brackets ({}), starting with a colon (:) followed by .format.

This example will print the number 3.140000.

print("{:f}".format(3.14))

You can also include a number to specify how many decimal places you want to be printed. Do so by including a . and the number of decimal places before your formatting type.

This example will print the number 3.14.

print("{:.2f}".format(3.14))

You can also include sensors with the format method to change how many decimals are returned when the sensor’s value is reported.

print("{:.2f}".format(brain.timer.time(SECONDS)))

New Lines#

By default, Python will add a new line after each print command. To print multiple values to the same line, use the end parameter.

In this example, the text from both print commands will be printed on the same line.

print("This text will be ", end="")
print("printed on the same line")

Different Colors#

You can change what color the text will be when printing to the Print Console by using the following color codes:

  • [31m - Red

  • [32m - Green

  • [34m - Blue

  • [30m - Black

  • [37m - White

  • [33m - Yellow

  • [91m - Orange

  • [35m - Purple

  • [36m - Cyan

  • [97m - Transparent

All color codes need to follow an escape sequence = \033 in order to function.

You can either use this directly in a print command with a string.

# Print VEXcode in Red to the Print Console.
print("\033[31mVEXcode")

Or, you can use it on its own to set all print commands afterwards to the set color.

# Set the Print Console text color to Red before printing VEXcode.
print("\033[31m")
print("VEXcode")

Returns: None.

Clear the Print Console#

By using \033[2J inside of the print command, you can clear the entire Print Console. This will also set the cursor back to row 1.

The example below will print “VEXcode” and then clear the Print Console after 2 seconds.

print("VEXcode")
wait(2, SECONDS)
print("\033[2J")

previous

PotentiometerV2

next

Pwm

On this page
  • Commands
    • Print to the Print Console
      • Format
      • New Lines
      • Different Colors
    • Clear the Print Console
Innovation First, International

VEX and VEX Robotics are trademarks or service marks of Innovation First, Inc. Copyright ©2025. All Rights Reserved. VEX Robotics, Inc. is a subsidiary of Innovation First International, Inc. All other product names / marks of others are the property of their respective owners. Patents and / or Patents Pending - innovationfirst.com/patents
Site Privacy Policy / Site Terms of Use / Cookie Policy / Software Privacy Policy

Visit the VEX Robotics Facebook Page Visit the VEX Robotics Twitter Page Visit the VEX Robotics Instagram Page Visit the VEX Robotics YouTube Page
VEX API Feedback Form

We value your feedback! Use this form to share suggestions, compliments, or report errors with the VEX API. Your input helps us enhance the VEX API documentation.

If you are experiencing technical issues or require customer support, please visit support.vex.com.

  • Send Happy Feedback
  • Send Sad Feedback

Note: the current URL will be shared with your message

By including your email address, you agree that VEX may send you email emails if we have questions about your feedback.
Privacy Policy >
Choose Which VEX IQ Generation to View

VEX IQ (1st gen)

VEX IQ (2nd gen)