Re: [Tutor] Problem with running Python
On 22-Apr-11 07:13, Alex Butler wrote: Hello all, I am new to programming on Python and am teaching myself. I have figured Hi, Alex, welcome to programming and the Python language. If you want to get the most out of this list, it helps to ask very specific questions, showing what you have tried so far to figure out your problem, with what results. Including examples of your actual code and actual error messages is enormously helpful. out some basics of coding, however whenever I try to run the program or check its functionality (Alt + X on my windows) it always comes back saying that “there’s an error in your program: invalid syntax.” However, when it returns to the IDLE page and highlights the error, it highlights the 7 in the python 2.7.1 above any coding. And if I am able to delete that text, it then links the syntax error to the multiple ‘’ in the code. Is this a common issue with a simple fix? Thanks It sounds to me like you're confusing the actual program code with other stuff like the prompt Python's interpreter types to you. Are you cutting and pasting more into IDLE than the Python program code itself? You should not have things like Python 2.7.1 or showing up in your source code. -- Steve Willoughby / st...@alchemy.com A ship in harbor is safe, but that is not what ships are built for. PGP Fingerprint 4615 3CCE 0F29 AE6C 8FF4 CA01 73FE 997A 765D 696C ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Problem with running Python
Alex Butler ambut...@bowdoin.edu wrote I am new to programming on Python and am teaching myself. I have figured out some basics of coding, however whenever I try to run the program or check its functionality (Alt + X on my windows) it always comes back saying that there's an error in your program: invalid syntax. However, when it returns to the IDLE page and highlights the error, it highlights the 7 in the python 2.7.1 above any coding. And if I am able to delete that text, it then links the syntax error to the multiple '' in the code. Is this a common issue with a simple fix? Thanks It sounds like you may be trying to execute the code in the shell window. This won't work because of all the stuff that the interpreter prints. Thus in the interactive prompt you see: print( hello world) But in your program file you only type: print( hello world ) The bit is part of the interpreter not the program. From your comments thats the best that I can guess. If thats not the problem then we will neeed more detail about what exactly you are doing and the specific error messages you get printed. You might find Danny Yoo's introduction to IDLE useful for a visual reference. http://hkn.eecs.berkeley.edu/~dyoo/python/idle_intro/index.html Its for Python 2.4 but the principles of using it for later versions are exactly the same. -- Alan Gauld Author of the Learn to Program web site http://www.alan-g.me.uk/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor