I have a pretty simple Python script that contains a function call like
f(var, other_var)
i.e. a function that receives several parameters. All these parameters can be obtained within f and have values.
When I call instead
cProfile.run('f(var, other_var)')
it crashes with an error message:
NameError: "name 'var' is not defined"
Python version
Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
What's going on here?
source
share