Getting started makes me feel pretty dumb. I am on problem set zero and I'm not understanding how to go from writing the code in IDLE to testing the program. Where do I save it, and then how do I run it?
When you are in IDLE , go to file and start new, then start writing code instead of writing in IDLE itself. You can save this file and run it later. I hope this makes sense I ran into same problem when I started.
It also helps to type in the file extension yourself when saving the file.
And to quickly execute it, you can hit F5 after saving (in the edit file mode)
noob.py: Your response sounded intriguing, and I tried it, but I couldn't make it work. For newbies, "start writing code" sounds like what we were already doing. When I tried to "start new" in IDLE, "New window" was the only option I had, so I tried that. In the new window, where there was no >>> prompt, I tried doing what I'd done in the first window ("within the shell," I guess that's called), and got no response -- only what I typed myself. What should I be doing differently, when there is no prompt, and what is the goal? Thanks!
it took me a while to figure this out as well. in the actual python shell you can test each line out... but not run it there. if you do go to the file - new window, you get an empty looking screen. not prompts >>> this is correct. immediately go to file - save and type out your name ex: ps0.py if you copy the lines that worked for you in the shell in their order into this window you are writing the actual program that you want to test. to get it to run on the python shell now, when you are in the editor window (the one with no >>> prompts) go to Run - Check Module if you haven't saved it will prompt you to do so, and then switch you to the python shell and carry out the commands that you typed into the other screen. does this make a little more sense?
Join our real-time social learning platform and learn together with your friends!