Last answered:

06 Apr 2020

Posted on:

04 Apr 2020

0

Console Spyder

I'm confused by the difference between 'console' on bottom right of Spyder...and the progamming area on the left. When I type len('myname') in the left programming area and run it fails in console (of course) But when i type len('myname') directly in the console area it correctly returns '6'. I've researched multiple videos/websites for an answer to this trivial question with no success. I'm just trying to understand the difference between the 'console' area and the programming area, as I don't recall it ever being specifically explained.
3 answers ( 0 marked as helpful)
Posted on:

05 Apr 2020

0
Hi Jon, Do you get an error or no output ? When I run in the left programming area I dont get an error, instead I get not output. I am new to spyder and to python overall, but the situation you presented made me remember a concept when I had C classes on college almost two decades ago. In C we have the ability to redirect the output to either the screen, to a file, to another program and so on. If python/spyder follows the same logic, maybe this can be explained by the fact that the standard output on the console is your screen while there is no output specified when you run a command in the left area. When you run a command like print(len(‘myname’)) you are essentially instructing python to redirect the output of command len(‘myname’) to the standard output device, your screen.
Posted on:

05 Apr 2020

0
Just to restate my query. The instructor types programs into the programming space to the left and clicks run then the result is seen in the console At other times he'll type a command directly into the the console and get a result.   I'm just trying to understand the difference between the two areas.
Posted on:

06 Apr 2020

0
What course and class for instance did you notice this ? What I tried to convey In my answer is that the console is connected to your screen while the left area is not. You should use the left area. I havent tested but I doubt some features of IDEs like code completion are available in the console.

Submit an answer