Consola#
Introducción#
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.
A continuación se muestra una lista de todos los métodos disponibles:
Acciones – Interactuar con la consola de impresión.
print
– Print text to the console.Borrar consola de impresión – Borra el texto de la consola.
Comportamiento#
print#
print
prints text in the console using the current cursor position.
Usage:
print(string, end)
Parámetros |
Descripción |
---|---|
cadena |
El texto que se imprimirá como una cadena. |
fin |
Optional. The string added to the end of the printed text. Specified as |
# 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")