Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-130160: use.. program:: directive for documentingcProfile CLI#130314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
sobolevn merged 5 commits intopython:mainfromApostolFet:fix-issue-130160
Mar 1, 2025
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletionsDoc/library/profile.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -123,23 +123,32 @@ them in various ways.

.. _profile-cli:

.. program:: cProfile

The files :mod:`cProfile` and :mod:`profile` can also be invoked as a script to
profile another script. For example::

python -m cProfile [-o output_file] [-s sort_order] (-m module | myscript.py)

``-o`` writes the profile results to a file instead of to stdout
.. option:: -o <output_file>

Writes the profile results to a file instead of to stdout.

.. option:: -s <sort_order>

Specifies one of the :func:`~pstats.Stats.sort_stats` sort values
to sort the output by.
This only applies when :option:`-o <cProfile -o>` is not supplied.

``-s`` specifies one of the :func:`~pstats.Stats.sort_stats` sort values to sort
the output by. This only applies when ``-o`` is not supplied.
.. option:: -m <module>

``-m`` specifies that a module is being profiled instead of a script.
Specifies that a module is being profiled instead of a script.

.. versionadded:: 3.7
Added the ``-m`` option to :mod:`cProfile`.
.. versionadded:: 3.7
Added the ``-m`` option to :mod:`cProfile`.

.. versionadded:: 3.8
Added the ``-m`` option to :mod:`profile`.
.. versionadded:: 3.8
Added the ``-m`` option to :mod:`profile`.

The :mod:`pstats` module's :class:`~pstats.Stats` class has a variety of methods
for manipulating and printing the data saved into a profile results file::
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp