Question:
How do i edit after getting a syntax error?
2012-05-18 12:38:16 UTC
This is my first day of programming ever, and i am using python. I can not figure out how to go back and edit a line after python tells me there is a syntax error. It says that there is an error and then i cannot edit anything above that.
Three answers:
?
2012-05-18 12:50:56 UTC
Unfortunately you can't... so if you downloaded python you probably got IDLE



in IDLE hit options --> configure IDLE and under the general tab tell it to open an edit window at startup. This way you can type a script or a few lines, run it with F5, close the shell window if you need to, and go back to the edit window and edit.



Unlike the other poster I do recommend Python as a good first language and it will help with other languages (like C, C++, and Java) in the future which is more than can be said for something like visual basic.
Thomas Bladen-Hovell
2012-05-19 21:26:51 UTC
Don't learn Visual Basic, it teaches you a load of bad habits. I started my programming hobby with Python, and once you learn the important syntax, you can do pretty much anything you want, and there's loads of help available online.



From what you've described, I assume your using IDLE; and that you're trying to edit a line that's already been entered. If this is true, you can either click on that line, press enter, then enter the line that's next to the last (bottom) >>>



Alternatively, retype the entire line.



Email me if you're still having problems (Click the Email link on my account page)
Jake
2012-05-18 19:42:47 UTC
I know that it can be aggravating and slow, but I would recommend learning something like Visual Basic before you jump into something like Python. If you're seriously interested in programming, that would be a better path to take. It'll help you understand all languages better!


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...