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

Function run

Lib/profile.py:90–101  ·  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

88#**************************************************************************
89
90def run(statement, filename=None, sort=-1):
91 """Run statement under profiler optionally saving results in filename
92
93 This function takes a single argument that can be passed to the
94 "exec" statement, and an optional file name. In all cases this
95 routine attempts to "exec" its first argument and gather profiling
96 statistics from the execution. If no file name is present, then this
97 function automatically prints a simple profiling report, sorted by the
98 standard name string (file/line/function-name) that is presented in
99 each line.
100 """
101 return _Utils(Profile).run(statement, filename, sort)
102
103def runctx(statement, globals, locals, filename=None, sort=-1):
104 """Run statement under profiler, supplying your own globals and locals,

Callers

nothing calls this directly

Calls 2

_UtilsClass · 0.70
runMethod · 0.45

Tested by

no test coverage detected