Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Basics Types and Branching Strings and Operators

Matthew Vega-Sanz
Matthew Vega-Sanz
4,355 Points

How do i choose if to use the console or workspace? What is the use case for each

I'm on the basic python course and noticed for most of the course we code or do our work in the workspace but in the strings video we primarily just use the console. how do we choose which we use? Are there certain reasons to code in one vs the other?

2 Answers

Luke Ward
Luke Ward
9,142 Points

When just using the console you are using the python shell, which is an interactive area to execute single python commands. So far example if you want to test a new python function that you have read in the docs say for example .strip(), you can open the python shell and see the output when using the function. Anything that you do in the python shell if forgotten as soon as you leave so you would never write a full application in the shell.

When you are using the workspace you are essentially using a text editor to create files. This is where you will do the majority of your python coding, here you will write your classes, functions and methods. You will then have to open the console again, but rather than enter the python shell you will use the python command to run the python files you have just created. for example "python yourfile.py".

You mostly write your code in the workspace and test its abilities in the console. At least thats how I've been using workspace and my personal IDE. You can run the shell in the console, thats a good place for testing new stuff and just messing around.