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

I finally found IDLE (Thank you vt_kick). But whenever I hit enter to go to another line of code, it runs the code on that line. I tried "indenting" the code by adding 2 #s infront of it but I was unable to delete that afterward & couldn't run the code. Does anyone know how to insert multiple lines of code before running it?

OpenStudy (anonymous):

It sounds like you are working in the 'Python Shell' itself, where the code is executed. You need to open a text editor file to write a block of code. Go to the file menu on the shell and open a new window. Be sure to save the file as a '.py'. I found that if I didn't do this it would save it as as simple text file, and the Python context colors would not show up.

OpenStudy (anonymous):

The Python shell always has a little >>> at the beginning of the code you are writing while the editor does not. vt_kick is correct you sound like you are in the shell.

OpenStudy (anonymous):

I think if you go to File/New window (Ctrl+N) you can write all your code there, and then, you go to Run/Run module (F5)

OpenStudy (andrew.israel):

str1 = "this is string example....wow!!!"; str2 = "exam"; print (str1.find(str2)) print (str1.find(str2, 10)) print (str1.find(str2, 40)) save this file with a name and see if it attaches a py to it. if you can run this successfully you are in business. output: >>> ================================ RESTART ================================ >>> 15 15 -1

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!