Skip to content

Commit

Permalink
Add REPL quickstart subsection
Browse files Browse the repository at this point in the history
  • Loading branch information
sed-i committed Jun 10, 2022
1 parent 1c05345 commit 1c237f1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Installation
Quickstart
----------

Here's a simple example that shows basic usage of the library. The example
connects to the currently active Juju model, deploys a single unit of the
ubuntu charm, then exits:
Expand Down Expand Up @@ -103,6 +104,25 @@ example, to run ``examples/connect_current_model.py``, use:
tox -e example -- examples/connect_current_model.py
REPL
^^^^

To experiment with the library in a REPL, launch python in asyncio mode

.. code:: bash
$ python3 -m asyncio
and then, to connect to the current model and fetch status:

.. code::
>>> from juju.model import Model
>>> model = Model()
>>> await model.connect_current()
>>> status = await model.get_status()
Versioning
----------

Expand Down

0 comments on commit 1c237f1

Please sign in to comment.