Clarify use of freeze in pip in program example

This commit is contained in:
Devesh Kumar Singh 2020-03-28 16:45:25 +05:30
parent e1e558835c
commit be2268ee87
2 changed files with 5 additions and 2 deletions

View File

@ -814,8 +814,8 @@ This is easily done using the standard ``subprocess`` module::
subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'my_package'])
If you want to process the output further, use one of the other APIs in the
module::
If you want to process the output further, use one of the other APIs in the module.
We are using `freeze`_ here which outputs installed packages in requirements format.::
reqs = subprocess.check_output([sys.executable, '-m', 'pip', 'freeze'])
@ -832,3 +832,5 @@ of ability. Some examples that you could consider include:
* ``distlib`` - Packaging and distribution utilities (including functions for
interacting with PyPI).
.. _freeze: https://pip.pypa.io/en/latest/reference/pip_freeze/

1
news/7008.doc Normal file
View File

@ -0,0 +1 @@
Clarify the usage of freeze command in the example of Using pip in your program