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 trialMatthew Vega-Sanz
4,355 PointsHow 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
9,154 PointsWhen 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".
Michael Cronk
8,970 PointsYou 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.