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.