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 filenameWhat's Leo's idiomatic way to get the path of the currently running script in Leo?
What's Leo's idiomatic way to get the path of the currently running script in Leo?Not sure I know what you mean by the "currently running script". There are several ways of getting important directories.
What's Leo's idiomatic way to get the path of the currently running script in Leo?Not sure I know what you mean by the "currently running script". There are several ways of getting important directories.I meant the name of the file that is created and then run when executing Ctrl-B or using @button. It's part of troubleshooting #1376. I have since determined Ctrl-B name is predictable: always HOME/.leo/scriptFile.py.
(It occurs to me re-using the same name is a problem waiting to happen. Now that multiple Leo sessions can run concurrently so long as they're not editing the same .leo file, who's to say which one created the file that's about to be run?)