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

Commit5181ddb

Browse files
ApostolFetpicnixzAA-Turner
authored
gh-130160: use.. program:: directive for documentingcProfile CLI (#130314)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
1 parenta98a6bd commit5181ddb

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

‎Doc/library/profile.rst

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,23 +123,32 @@ them in various ways.
123123

124124
.. _profile-cli:
125125

126+
..program::cProfile
127+
126128
The files:mod:`cProfile` and:mod:`profile` can also be invoked as a script to
127129
profile another script. For example::
128130

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

131-
``-o`` writes the profile results to a file instead of to stdout
133+
..option::-o <output_file>
134+
135+
Writes the profile results to a file instead of to stdout.
136+
137+
..option::-s <sort_order>
138+
139+
Specifies one of the:func:`~pstats.Stats.sort_stats` sort values
140+
to sort the output by.
141+
This only applies when:option:`-o <cProfile -o>` is not supplied.
132142

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

136-
``-m`` specifies that a module is being profiled instead of a script.
145+
Specifies that a module is being profiled instead of a script.
137146

138-
..versionadded::3.7
139-
Added the ``-m`` option to:mod:`cProfile`.
147+
..versionadded::3.7
148+
Added the ``-m`` option to:mod:`cProfile`.
140149

141-
..versionadded::3.8
142-
Added the ``-m`` option to:mod:`profile`.
150+
..versionadded::3.8
151+
Added the ``-m`` option to:mod:`profile`.
143152

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp