On Mon, Oct 29, 2018 at 10:19 AM Sapphira Armageddos wrote:
Hello Sapphira. Welcome aboard.
what's considered best coding practice for storing Leo specific python code
> that I'd reuse elsewhere?
>
Good question. There are several ways to reuse code:
1. You can define abbreviations. This lets you insert code, but not
execute it.
Abbreviations can expand to trees, so you aren't limited. You would
typically store them in myLeoSettings.leo, (open with the my-leo-settings
command) the one of these nodes:
@data global-abbreviations
@outline-data tree-abbreviations
See leoSettings.leo for details.
2. Any @button or @command node defined in myLeoSettings.leo will be
available in all open outlines:
- @b shows the list of @button commands.
- @c shows the list of @command commands.
3. You can dump code into, say, scripts.leo. Open with leo-scripts-leo.
4. Or define @command open-my-scripts this way:
g.openWithFileName('')
HTH.
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.