I am a beginner with Python/Spyder and I have a question about debugging. I 
am not sure if it is a Spyder-specific question.

I set a breakpoint at the last line of the code at the bottom of this email 
(all within a function in a module, all at the same level of indentation). 
The debugger stops at the breakpoint, as expected. However, if I highlight 
the second line of code below and try to execute it by clicking on the "Run 
selection or current block of lines" button I get a message:

(Pdb) bw_stats = [mat_stats_foo(x) for x in sample_mat]
*** NameError: global name 'mat_stats_foo' is not defined

The same thing happens if I just cut the code and paste it on the console. 
The function mat_stats_foo has been defined just above.

I am puzzled since the same code has just been executed by the debugger.

Any suggestions? Explanations?

    sample_mat = ret[index_vec]
    bw_stats = [mat_stats_foo(x) for x in sample_mat]
    bw_stats_arr = np.array(bw_stats).transpose()

-- 
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to