KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am currently using NetBeans IDE with Jython 2.5.1 When debugging my project step by step, as soon as an iteration over a generator is encountered, the debugger goes straight to the end of the code. The output works ok, but it is impossible to do step by step debugging once the first generator is met. Is this a standard behavior for Python debugging in all Python IDE? Is it not possible to debug the code "yield after yield" the same way we can debug VBA for each element of a "for" loop (sorry for the mention of VBA :)? Thanks. EDIT Without the generator Code: def example(n): i = 1 while i <= n: yield i i += 1 print "hello" print "goodbye" Output: hello goodbye Debugging: [LOG]PythonDebugger : overall Starting [LOG]PythonDebugger.taskStarted : I am Starting a new Debugging Session ... [LOG]This window is an interactive debugging context aware Python Shell [LOG]where you can enter python console commands while debugging (...) >>>[stdout:]hello >>>[stdout:]goodbye Debug session normal end With the Generator Code: def example(n): i = 1 while i <= n: yield i i += 1 print "hello" for n in example(3): print n print "goodbye" Output: hello 1 2 3 goodbye Debugging: [LOG]PythonDebugger : overall Starting [LOG]PythonDebugger.taskStarted : I am Starting a new Debugging Session ... [LOG]This window is an interactive debugging context aware Python Shell [LOG]where you can enter python console commands while debugging (...) >>>[stdout:]hello >>>None['GeneratorExit deamon ended '] Debug session normal end
Tags (comma-separated)
Save Edits
Cancel