Quantcast

A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

liaoee

  • 2 years ago

I am starting Pset 0. How do I write a program in IDLE. As in, I want to be able to write more than one line of code before IDLE runs my code. Thanks!

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

    You can either use an editor to write your code and IDLE to run it, or grab a program called PyScripter, http://code.google.com/p/pyscripter/, lovely little ide for python that is free.

  2. bwCA
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    from the IDLE shell window you can open an editor window with menu item File | New Window after you have written code in the editor, F5 will run it with the results displayed in the shell window. be sure to save files with a .py extension to preserve the syntax highlighting.

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

    thanks guys! so it's a blank page. Do I need to add anything before getting started?

  4. eSpeX
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    Just the comments for the assignment are the only thing I can think of until you start importing things.

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

    i tried running this: x = raw_input('Please enter your birthdate (mm/dd/yyyy): ') y = raw_input('Please enter your last name: ') print x + y but it doesn't work.. am i missing something?

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

    also are we encouraged to asked questions, or look up previous questions? if the latter, how do i do so?

  7. eSpeX
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    For looking up questions you can use the codeacademy forum or google.

  8. eSpeX
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    When you say that your code didn't work, what "did" it do?

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

    it didn't prompt me for anything, and it gives back whatever i type

  10. eSpeX
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    You are typing in the editor and using F5 to run it?

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

    ah... that's why

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

    nice it works!

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

    Thank you so much. I'll keep working on it.

  14. eSpeX
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    You're welcome. Check out PyScripter if you have some free time. I personally prefer that over the IDLE editor.

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

    could you explain that to me a bit? like the difference between terminal and editor etc?

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

    so i downloaded python, and then idle. did i need idle?

  17. eSpeX
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    IDLE comes with Python, once you download and install the package you will have all you need to write in Python.

  18. eSpeX
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    The PyScripter is an IDE for Python, basically the same as the IDLE editor, just with a better user interface.

  19. eSpeX
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    The difference between an editor and terminal, is that in the terminal your commands are processed as soon as you hit the enter key.

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

    so what's the difference between command line and GUI?

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

    i just noticed that one is black and one is white

  22. eSpeX
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    Command line typically refers to a terminal, like if you were to open the "command prompt" in windows. GUI stands for Graphical User Interface, and typically refers to a "windowed" environment.

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

    but idle is terminal, right? and it's GUI?

  24. eSpeX
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    Technically IDLE is a GUI for the terminal.

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

    so GUI is basically just a better looking terminal, and the editor is where we actually write a program

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

    and then what's IDE?

  27. eSpeX
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    Well a GUI is a graphical representation for many interfaces, most likely you are using a GUI web browser to view this page. :)

  28. eSpeX
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    An IDE is and Integrated Development Environment. It brings together many of the tasks associated with programming into a nice user interface. You are presented with buttons to build your program, vs having to run a command on the command line.

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

    got it! thnx!

  30. eSpeX
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    You're welcome.

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

    hey when does print need parenthesis after it? i saw an example where if the variable is called x, no parentheses are used, and another where the variable is "changing," and parenthese were used...?

  32. eSpeX
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    The parenthesis aren't necessary. They most likely give away that the person writing the program was a 'C' programmer.

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

    i see..

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

    so for pset 0 that was it right? three lines? no loops?

  35. bwCA
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    version 3+ of Python requires parens for the print function

  36. eSpeX
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    @bwCA beat me to it, I started playing with 3.x last night and discovered that the parenthesis were in fact required. There are some other changes as well that can create a learning speed-bump, so I'd suggest you stick with 2.7.x until you are more familiar with the language.

  37. eSpeX
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    And yes, that was it for your ps0, the bulk of the assignment was getting Python installed and familiarizing you with entering code.

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