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

I'm in PSet 0. My commands work fine in Idle, but when I try to run it in a new window, it says I have an error (invalid syntax) and highlights the middle '>' of my first line after the comments...

OpenStudy (rbx):

Could you attach your code file ?

OpenStudy (anonymous):

here it is!

OpenStudy (rbx):

'>>>' are not parts of program and should not be written. Your codefile should contain only (and the comments) - x=raw_input('what is your date of birth?') y=raw_input('what is your last name?') print 'your last name is ',y print 'your birth date is ',x

OpenStudy (anonymous):

Exactly right; '>>>' are the default prompt when running in shell mode, and are typically included when quoting code to show the beginning of each line of code in the event of unintentional wrapping or breaking of lines

OpenStudy (anonymous):

Thanks. I see that now. I don't understand the interface between Idle and the other window where one actually runs the program.

OpenStudy (anonymous):

actually, it's more accurate to think of it as one actually stores the program. you can run from either window, but the editor window is the one that gives you the ability save your code you should get the same result running the same code from either, but when you have an error and you've just typed up a 10-15 line loop, it's great to be able to just edit the line and run again instead of having to retype or use arrows to recreate each line

OpenStudy (anonymous):

I'm sorry, but can you please walk me through this? I have my program in my IDLE shell, with commands that work line by line. How do I run the whole thing? How do I get my whole program written out in another window for submitting?

OpenStudy (rbx):

Look at the attached picture. Code needs to be written in the Editor window (left) as you'd normally enter on Python shell, then simply select 'Run Module' from 'Run' menu to get it executed in Python shell (right).

OpenStudy (anonymous):

Thanks a lot for your patience! It seems to work now. I guess I had the two windows mixed up in my mind.... thanks again.

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!
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!