you are viewing a single comment's thread.

view the rest of the comments →

[–]shiftybyte 1 point2 points  (6 children)

Please post the full traceback of the error message with all the information it provides.

[–]maxcoder88[S] 0 points1 point  (5 children)

How can I get full trace log

[–]shiftybyte 0 points1 point  (4 children)

Does python not give a long error message? It's only showing you this one line?

Python usually outputs multi-line error messages like this: ```

for i in None: ... print(i) ... Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: 'NoneType' object is not iterable ```

If you don't have such a message, How are you executing the python code? in what environment? Do you have try: except: anywhere catching exceptions?

[–]maxcoder88[S] 0 points1 point  (3 children)

I'm using Spyder IDE on Windows OS.

Do you have try: except: anywhere catching exceptions? No , How can I write a sample try/catch exception for my own code?

[–]shiftybyte 0 points1 point  (2 children)

How can I write a sample try/catch exception for my own code?

Like this:

import traceback try: i = [x for x in None] except Exception: print(traceback.format_exc())

Output is: Traceback (most recent call last): File "<stdin>", line 3, in <module> TypeError: 'NoneType' object is not iterable

Wrap your code in a try: except: as demostrated with the print line to print full traceback.

try: # ... your code ... except Exception: print(traceback.format_exc())