MCPcopy Index your code
hub / github.com/python/cpython / run

Function run

Lib/profiling/tracing/__init__.py:18–29  ·  view source on GitHub ↗

Run statement under profiler optionally saving results in filename This function takes a single argument that can be passed to the "exec" statement, and an optional file name. In all cases this routine attempts to "exec" its first argument and gather profiling statistics from the e

(statement, filename=None, sort=-1)

Source from the content-addressed store, hash-verified

16# Simple interface
17
18def run(statement, filename=None, sort=-1):
19 """Run statement under profiler optionally saving results in filename
20
21 This function takes a single argument that can be passed to the
22 "exec" statement, and an optional file name. In all cases this
23 routine attempts to "exec" its first argument and gather profiling
24 statistics from the execution. If no file name is present, then this
25 function automatically prints a simple profiling report, sorted by the
26 standard name string (file/line/function-name) that is presented in
27 each line.
28 """
29 return _Utils(Profile).run(statement, filename, sort)
30
31def runctx(statement, globals, locals, filename=None, sort=-1):
32 """Run statement under profiler, supplying your own globals and locals,

Callers

nothing calls this directly

Calls 2

_UtilsClass · 0.90
runMethod · 0.45

Tested by

no test coverage detected