You must Sign In to post a response.
  • Problem of non display of syntax errors within a python program


    Cannot see what are syntax errors in a python program? Check out with expert advice why this is so & how to resolve the issue.

    I am working with dinosaur program of python, which is a very good work base for me. I am in severe problems at present, with the syntax errors not showing me the red lines to tell where the problem is. Can somebody explain why there is a non-display of such errors and what I can do about it?
  • Answers

    2 Answers found.

  • Python errors usually show the error in numbers on command line. I assume you're running the program on command line. So in such case you have to check the error written in the console.

    For example, check the code failed on console with message such as following :

    File "", line 1, in ?
    while True print 'Hello world'
    SyntaxError: invalid syntax

    In the above example the error is after or near line 1. The error in question could be because of the loop.

    If you're using IDE like Pycharm from Netbrains then you'll be able to debug upto the error point. There is also feature of step wise debugging to check where is the source of error.

    I suggest you to use IDE like Pycharm or Eclipse Python IDE plugin. That way you can view and read about the errors.

  • thank you for the helpings.

    many good days komrade


  • Sign In to post your comments