The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

Console Spyder

Console Spyder

0
Votes
3
Answer

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
Votes

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.

0
Votes

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.

0
Votes

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.

×
LAST CHANCE
Ready to Learn Data Science?
50% OFF