What's Leo's idiomatic way to get the path of the currently running script 
in Leo? I've been using the below, but it's proven unreliable in Leo 
(differs between `Ctrl-B` and `--script=xx`), and there's probably already 
a Leo function which does this anyway, right?

def get_my_path():
    """Return full path of currently running script or executable    
   Thanks to
        https://stackoverflow.com/questions/2632199/
            how-do-i-get-the-path-of-the-current-executed-file-in-python
        @jose-crespo-barrios, https://stackoverflow.com/a/44592299/14420
    """
    import inspect

    filename = inspect.getframeinfo(inspect.currentframe()).filename
    return filename

-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/0fbaa565-d15e-4911-828c-7f87880ca24c%40googlegroups.com.

Reply via email to