A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • 5 years ago

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?

  • This Question is Closed
  1. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

  2. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

  3. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

  4. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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?

  5. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

  6. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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

  7. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

  8. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

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

  9. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.