Absolute novice with programming. Apparently I was wasting a members time with 10 words about myself so here is my edit and question sans any personality. :)
This morning, I opened up my laptop to practice (Mac OS 10.11.6). Reopened IDLE and the files from yesterday and continued practicing when I noticed the shell was not outputting anything unless I told it to print. In the editor I have:
1-1
x_list = [1,2,3]
x_list
print(x_list)
The shell returns this:
>>>
RESTART: /Users/plaksatyler/Desktop/Python Practice Code/Do Not Give Up/GibberishTest.py
>>>
RESTART: /Users/plaksatyler/Desktop/Python Practice Code/Do Not Give Up/GibberishTest.py
>>>
RESTART: /Users/plaksatyler/Desktop/Python Practice Code/Do Not Give Up/GibberishTest.py
[1, 2, 3]
>>>
I've removed and reinstalled IDLE two times, upgraded PIP and ran the Shell update command because I have no clue what to do. Any ideas would be greatly appreciated. Thanks!
This is not a glitch. When you are running programs from a file, only things that you tell it to print will be printed.
When you run it by typing in the lines (with the >>>
), all of the results will be printed.
Imagine how annoying it would be if every single line produced output in IDLE. Usually you only need to output things like results or messages.
If you want to use IDLE as a "programming calculator", you can just type everything into the shell (AKA >>>
window), not the editor.