A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • one year ago

Hello guys. First of all, it is important i think to say that i am new to programming. I dont understand how Prof Guttag ran his script in the 22;22 mark of the lecture 2(core elements of a program). I downloaded the python software and I am using its IDLE because i did not understand the concept of an IDLE or if there are different kinds of IDLE. In short, what did John mean when he said"So the first thing to say is that things look a little bit different when they're executed from a script than when you execute them directly in the interpreter.

  • This Question is Open
  1. rsmith6559
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    IDLE is what's called an Integrated Development Environment, an IDE. IDE's allow you to edit, compile ( not needed in Python ), run and debug programs all from one environment. As programs get bigger, more complex and you're under deadline, an IDE may be very helpful. There are some usually minor differences between executing a statement from the Python interpreter and in a program file. One of the easiest demonstrations is: in the Python interpreter enter 2 + 2 and press enter. The interpreter responds 4. Now put 2 + 2 into a file and execute that. You don't get any output. 2 was added to 2, but that was all that the program said to do, it didn't say to output the result. You'd need to change the program to: print 2 + 2 which will output 4. In the interpreter, the print version will also output 4.

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

    Thank you. you said 'There are some usually minor differences between executing a statement from the Python interpreter and in a program file.'. which of them is the IDLE and which is the other one wherein code appears different. I understand so far the reasoning behind his work on the IDLE. I guess IDLE is the interpreter, right?. but how do you 'execute a statement directly via a script?.''. what program do you use or something. sorry if my questions seem foolish.

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

    As far as the class go, and I'm at lecture 4, what i understood from Prof. John Guttag is the interpreter is what translate code to computer command, and we can use IDLE to enter that code kind of in real time or create a script and write the code and run it. You can start a blank script file in IDLE by going to File > Open Window. Write the code and execute it by going to Run > Run Module from the top menu or pressing F5 and the statements in the script will be executed. You can also save the script file from here.

  4. rsmith6559
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    IDLE is usually used with two windows. The blank window is for editing a program. The window with: Python 2.7.10 (default, Jul 14 2015, 19:46:27) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> or whatever, is the interpreter. The interpreter is also commonly referred to as the Python shell. IDLE includes the interpreter, and is actually a Python program.

  5. 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.