Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #85641

Re: line_profiler: what am I doing wrong?

From Neal Becker <ndbecker2@gmail.com>
Subject Re: line_profiler: what am I doing wrong?
Date 2015-02-13 08:35 -0500
References <mbe6ea$bl7$1@ger.gmane.org> <mbftdm$vk1$2@ger.gmane.org>
Newsgroups comp.lang.python
Message-ID <mailman.18729.1423834808.18130.python-list@python.org> (permalink)

Show all headers | View raw


Robert Kern wrote:

> @profile
> def run():
> pass
> 
> run()

No, this doesn't work either.  Same failure

kernprof -l test_prof.py 
Wrote profile results to test_prof.py.lprof
Traceback (most recent call last):
  File "/home/nbecker/.local/bin/kernprof", line 9, in <module>
    load_entry_point('line-profiler==1.0', 'console_scripts', 'kernprof')()
  File "/home/nbecker/.local/lib/python2.7/site-packages/kernprof.py", line 221, 
in main
    execfile(script_file, ns, ns)
  File "test_prof.py", line 1, in <module>
    @profile
NameError: name 'profile' is not defined

-- 
-- Those who don't understand recursion are doomed to repeat it

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: line_profiler: what am I doing wrong? Neal Becker <ndbecker2@gmail.com> - 2015-02-13 08:35 -0500

csiph-web