I'm missing something very basic.
class C:
def __init__(self):
self.N = 100
pass
def f(self, param):
print 'C.f -- param'
for k in xrange(param):
for i in xrange(self.N):
for j in xrange(self.N):
a = float(i)/(1+float(j)) + float(i/self.N) ** float(j/self.N)
import cProfile
c = C()
cProfile.run('c.f(3)')
When I run the above code in IPython, I get:
NameError: name 'c' is not defined
What am I missing?
UPDATE the exact paste of my session is here: http://pastebin.com/f3e1b9946
UPDATE I didn't mention that the problem occurs in IPython, which (at it turns out) is the source of the problem