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


Groups > comp.lang.python > #85488

line_profiler: what am I doing wrong?

From Neal Becker <ndbecker2@gmail.com>
Subject line_profiler: what am I doing wrong?
Date 2015-02-10 19:06 -0500
Newsgroups comp.lang.python
Message-ID <mailman.18635.1423613207.18130.python-list@python.org> (permalink)

Show all headers | View raw


I inserted 
@profile
def run(...)

into a module-level global function called 'run'.  Something is very wrong here.
1. profile results were written before anything even ran
2. profile is not defined?

 kernprof -l ./test_unframed.py --lots --of --args ...

Wrote profile results to test_unframed.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_unframed.py", line 721, in <module>
    @profile
NameError: name 'profile' is not defined


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


Thread

line_profiler: what am I doing wrong? Neal Becker <ndbecker2@gmail.com> - 2015-02-10 19:06 -0500
  Re: line_profiler: what am I doing wrong? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-11 11:27 +1100
    Re: line_profiler: what am I doing wrong? Neal Becker <ndbecker2@gmail.com> - 2015-02-10 19:45 -0500
      Re: line_profiler: what am I doing wrong? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-11 12:17 +1100
        Re: line_profiler: what am I doing wrong? Robert Kern <robert.kern@gmail.com> - 2015-02-11 15:42 +0000
          Re: line_profiler: what am I doing wrong? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-12 10:02 +1100
        Re: line_profiler: what am I doing wrong? Neal Becker <ndbecker2@gmail.com> - 2015-02-13 08:33 -0500

csiph-web