Leo command line options are ignored

47 views
Skip to first unread message

lewis

unread,
Apr 12, 2020, 1:56:39 AM4/12/20
to leo-editor
I have a windows PC where command line options for Leo are ignored. If I start leo with

launchleo.py --no-splash

leo starts and splash screen still appears.

Same occurs with
launchleo.py --gui=console

where Leo starts with PyQt5 gui, not the console gui as expected. This is not related to any recent build of Leo.
Has anyone any idea how to fix this?

Regards
Lewis

Edward K. Ream

unread,
Apr 12, 2020, 6:27:56 AM4/12/20
to leo-editor
On Sun, Apr 12, 2020 at 12:56 AM lewis <lewi...@operamail.com> wrote:
I have a windows PC where command line options for Leo are ignored.

Are you starting with a batch file?  If so, you should add %*.  For example, here is my leo.bat file:

python c:\leo.repo\leo-editor\launchLeo.py --gui=qttabs %*

Edward

Mike Hodson

unread,
Apr 12, 2020, 9:00:05 AM4/12/20
to leo-e...@googlegroups.com
Windows, vs *nix, actually places all the specifics on how to run something, into the registry, versus being properly posixy and looking at the #! shebang line for proper executable invocation.
So, indeed, 'python file.py --argument' works, but you need a registry entry similar to Edward's batch example (inclusive of %*)  to have "c:\> file.py --argument" work.  


Mike

 

Thomas Passin

unread,
Apr 12, 2020, 11:15:33 AM4/12/20
to leo-editor
It can get trickier if you have more than one python installation, as I do.  I keep python 2.7, since there are still a few older programs I may run that don't run with python 3+. It turns out that the 2.7 installation added its directories to the system path, and the 3.8 installation did not.

To be on the safe side, I run python 3.8 from a batch file that removes the python 2.7 entries from the path and adds python 3.8 ones.  This may be overkill, but better to be thorough.  Here's my batch file for running python 3.8:

@echo off
setlocal

:: Remove Python 2.7 directories from path by adding "xxx" to their names
set _path=%PATH:C:\Python27=C:\Python27xxx%
path %_path%

:: Add Python 3.8 Scripts directory to PATH
path C:\Users\tom\AppData\Local\Programs\Python\Python38\Scripts;%PATH%

"C:\Users\tom\AppData\Local\Programs\Python\Python38\python.exe" %*

endlocal

I use setlocal/endlocal so the path doesn't get changed permanently.

lewis

unread,
Apr 12, 2020, 7:20:16 PM4/12/20
to leo-editor
Thanks all. Fixed with a registry edit.

Lewis

Matt Wilkie

unread,
Apr 12, 2020, 7:32:22 PM4/12/20
to leo-editor
If you've installed Leo with pip there are leo launch wrappers in PYTHONHOME/Scripts that should correctly handle command line parameters regardless of whether you're on WIndows or Linux and without needing registry edits. They are functionally equivalent to the phrase "python path/to/launchLeo.py".

On Win they are: leo.exe, leo-messages.exe, and leo-console.exe.

-matt

Matt Wilkie

unread,
Apr 12, 2020, 7:35:19 PM4/12/20
to leo-editor

lewis

unread,
Apr 12, 2020, 7:41:44 PM4/12/20
to leo-editor
I have installed leo with Git. The issue of command line options first came up when I had multiple python versions installed.

Lewis
Reply all
Reply to author
Forward
0 new messages