Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

Rachel Harif
Rachel Harif
323 Points

How to clear the console in workspace?

This is probably a newbie question, but I'm trying to clear out the console in workspace so I can have a fresh page to run my programs. Is there a way to clear the console from whatever I was doing earlier in order to keep my workspace fresh?

7 Answers

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

You'll have to exit the Python interpreter, if you haven't already (exit()) and then, like Shawn Anderton said, clear and press return/enter in the console.

thomas shepard
thomas shepard
278 Points

treehouse:~/workspace$ python
Python 3.6.4 (default, Mar 6 2019, 21:22:09)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.

import math
math.ceil(21.24)
22
clear
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'clear' is not defined

Ctrl + L

type clear in the console.

James demby
James demby
10,296 Points

Thanks! very helpful Mr. Love

enter "quit"