I couldn't find anyway of retrieving the command which Leo was launched 
with unless I added lines like the below to the launch scripts, and that's 
just getting in too deep.

# name of the script we're running in
import inspect
g.es_print(inspect.getfile(inspect.currentframe()))



The problem part: 

command = f'python launchLeo.py "{fn}"'
os.system(command) 

I did find a crude but workable fix:

#command = f'python launchLeo.py "{fn}"'
#os.system(command)
import sys
command = f'{sys.executable} {g.app.loadDir}/runLeo.py "{fn}"'
#g.es_print(command)
import subprocess
subprocess.Popen(command)

Both sys and subprocess are likely already available as Leo commands, so no 
need to import the modules again. I just need to figure out what they're 
called.

-matt

-- 
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/86a0c6cd-34b4-46ae-9881-fcf61594c718%40googlegroups.com.

Reply via email to