Skip to content

Commit 741c6ab

Browse files
committed
Add modern quickstart instructions to README
1 parent 9db4f5a commit 741c6ab

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

README.rst

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,32 @@ They are available under a `BSD license`_.
3333
.. contents::
3434

3535

36-
Quick Start
37-
===========
36+
Quick Start (Modern)
37+
====================
38+
39+
This guide is for versions of line profiler starting a ``4.1.0``.
40+
41+
To profile a python script:
42+
43+
* Install line_profiler: ``pip install line_profiler``.
44+
45+
* In the relevant file(s), import line profiler and decorate function(s) you
46+
want to profile with ``@line_profiler.profile``.
47+
48+
* Set the environment variable ``LINE_PROFILE=1`` and run your script as normal.
49+
When the script ends a summary of profile results, files written to disk, and
50+
instructions for inspecting details will be written to stdout.
51+
52+
For more details and a short tutorial see `Line Profiler Basic Usage <https://kernprof.readthedocs.io/en/latest/#line-profiler-basic-usage>`_.
53+
54+
55+
Quick Start (Legacy)
56+
====================
57+
58+
This section is the original quick-start guide, and may eventually be removed
59+
from the README. This will work with current and older (pre ``4.1.0``) versions
60+
of line profiler.
61+
3862
To profile a python script:
3963

4064
* Install line_profiler: ``pip install line_profiler``.

0 commit comments

Comments
 (0)