profile.Profile.run()

run(cmd) Profile the cmd via exec().

profile.Profile.print_stats()

print_stats(sort=-1) Create a Stats object based on the current profile and print the results to stdout.

profile.Profile.enable()

enable() Start collecting profiling data.

profile.Profile.dump_stats()

dump_stats(filename) Write the results of the current profile to filename.

profile.Profile.disable()

disable() Stop collecting profiling data.

profile.Profile.create_stats()

create_stats() Stop collecting profiling data and record the results internally as the current profile.

profile.Profile

class profile.Profile(timer=None, timeunit=0.0, subcalls=True, builtins=True) This class is normally only used if more precise control over profiling is needed than what the cProfile.run() function provides. A custom timer can be supplied for measuring how long code takes to run via the timer argument. This must be a function that returns a single number representing the current time. If the number is an integer, the timeunit specifies a multiplier that specifies the duration of each unit of

ProcessLookupError

exception ProcessLookupError Raised when a given process doesn’t exist. Corresponds to errno ESRCH.

print()

print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False) Print objects to the text stream file, separated by sep and followed by end. sep, end and file, if present, must be given as keyword arguments. All non-keyword arguments are converted to strings like str() does and written to the stream, separated by sep and followed by end. Both sep and end must be strings; they can also be None, which means to use the default values. If no objects are given, print() will just write end. The f

pprint.saferepr()

pprint.saferepr(object) Return a string representation of object, protected against recursive data structures. If the representation of object exposes a recursive entry, the recursive reference will be represented as <Recursion on typename with id=number>. The representation is not otherwise formatted. >>> pprint.saferepr(stuff) "[<Recursion on list with id=...>, 'spam', 'eggs', 'lumberjack', 'knights', 'ni']"