I use -m all the time, including (mostly) running Leo. and running pip.
Another advantage with pip is that you always get the right version of pip,
which is really good when you have several versions of Python installed.
On Wednesday, September 22, 2021 at 8:58:41 AM UTC-4 Edward K. Ream wrote:
> A few days ago I had one of those "Why didn't I see this before?" moments.
>
> Invoking a python package via `python -m package` is simpler and more
> general. For example:
>
> python -m black -h
>
> There is no need to specify the path to black!
>
> We only need to ensure that `python` invokes python 3. We can do this with
> an alias (linux) or .cmd file (windows). Here is my python.cmd file:
>
> "C:\Users\Edward Ream\Python\Python39\python.exe" %*
>
> Now (in devel) Leo's "blacken-files" command invokes black this way:
>
> g.execute_shell_commands(
> f"&python -m black --skip-string-normalization {path}")
>
> Edward
>
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/leo-editor/aecc9c65-b103-44f0-b3b9-2aa21d2743acn%40googlegroups.com.