3
0
Fork 0

Add docs for subcommands

This commit is contained in:
Lance Edgar 2023-11-24 14:22:22 -06:00
parent 8759fb8d37
commit 6b110e567a
4 changed files with 127 additions and 110 deletions

View file

@ -10,6 +10,9 @@ A script is just a text file with Python code. To run it you
generally must invoke the Python interpreter somehow and explicitly
tell it the path to your script.
Note that a script is (usually) not installed as part of a package.
They can live anywhere.
Below we'll walk through creating a script.
@ -72,6 +75,14 @@ that this also gives you access to the :term:`app handler`::
config = make_config('my.conf')
hello(config)
Output should now be different:
.. code-block:: sh
$ python hello.py
hello George
from wutta
You are likely to need more imports; it is generally wise to do those
*within the function* as opposed to the top of the module. This is to
ensure the :func:`~wuttjamaican.conf.make_config()` call happens
@ -94,14 +105,6 @@ before all packages are imported::
config = make_config('my.conf')
hello(config)
Output should now be different:
.. code-block:: sh
$ python hello.py
hello George
from wutta
Logging
-------