Console#

Introduction#

The IQ (2nd gen) Console appears in the Monitor window and displays text output from your project. In other environments like VS Code, print will display text on the terminal. New projects begin with the cursor at row 1.

Below is a list of all available methods:

Actions – Interact with the Print Console.

Actions#

print#

print prints text in the console using the current cursor position.

Usage:
print(string, end)

Parameters

Description

string

The text that will be printed as a string.

end

Optional. The string added to the end of the printed text. Specified as end=. Default: end="\n", which is automatically hidden and moves the cursor to the next line.

# Display two messages consecutively
print("I'm printed on one line.")
print("I'm printed automatically on the next line!")

# Print three colors on one line in the Print Console
colors = ["Red", "Green", "Blue"]

for color in colors:
    print(color, end=", ")

Clear 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.

# Print to the console, then clear it after
# 2 seconds
print("VEXcode")
wait(2, SECONDS)
print("\033[2J")