Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 28 Online
OpenStudy (anonymous):

When I go to Idle, then to python shell then click on File and New Window, an Untitled window appears. But how do I then enter a program?

OpenStudy (anonymous):

Your program is the code that you write in that window. For example - If you wanted to print the famous "Hello, world!", you would type this code in that empty window: Print "Hello, world!" You will have to save it first, before running it.

OpenStudy (anonymous):

The problem I'm having is that the Untitled window really is empty, e.g., it doesn't have the characteristic >>> on it. If I type Print 'hello, world' and enter it, then nothing happens.

OpenStudy (anonymous):

It's supposed to be that way. Type your code without the prompts (>>>) in that window. Save that code somewhere on your computer and then press f5, in that same window where you wrote the code, to run it. The code you just typed will run in the SHELL. Python knows automatically where the prompts are, so if you have no errors, it will do what you wrote. Think of that new window as your own .py document that you are working on until you test drive it.

OpenStudy (anonymous):

Thanks Aslander, so far so good. What you said to do worked fine when I typed in Print 'Hello, world'. But when, instead, I typed in 2**3, then saved it, then typed F5, I just got >>> on the python shell without the answer. Did I do something wrong?

OpenStudy (anonymous):

Dear Aslander, O.K. Thanks to you, I think I finally have it all straight now so that I can write a program, save it, run it, change what's wrong, etc. I didn't know about pressing F5 until you told me. Is that written down somewhere in the official Python intstructions? Thanks again for your help.

OpenStudy (anonymous):

No - that is just a shortcut. You can find more if you open your Shell and click any menu heading like Format or Run. The keyboard shortcuts are written right beside the function you want. As for why 2**3 did not print - I am not entirely sure, but you would need to add the print command before the 2**3 to print the answer when running it. Like this: print 2**3

OpenStudy (anonymous):

Thanks for all the helpful info. Can you help with this further question? When I click on IDLE that puts me into the Python Shell, all right. But I can't find any menu heading there like Format or Run. If I click on Help in the Shell then that tells me that "somehow" Format is under the Edit heading, but that seems to lead me nowhere.

OpenStudy (anonymous):

Oh - The menu items I was referring to are found when you open a "New Window".

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
ARTSMART: Art!
2 hours ago 4 Replies 3 Medals
Jasonisyours: What were the key causes of the French Revolution in 1789?
3 hours ago 2 Replies 4 Medals
PureSoulless: Why is the word "Pedophile" always censored in yt vids?
1 day ago 3 Replies 0 Medals
Jalli: What's 58x3634u00b07
20 hours ago 6 Replies 3 Medals
arriya: who wanna play roblox
1 day ago 5 Replies 1 Medal
brianagatica14: Any artist on here?
3 days ago 7 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!