There's a node in LeoDocs about getting arguments. Look for the headline "Getting interactive input in scripts and commands".
sys.argv will give you the arguments that the Python interpreter received at startup. Another way I've passed arguments to a script is via the clipboard, but of course you have to get them into the clipboard first. On Monday, December 9, 2024 at 4:36:37 PM UTC-5 jkn wrote: > I've been meaning to ask this for ever...Is there a way to pass > argument(s) to leo @command-s? > > If I have a node like > > @command test_args > import sys > g.es(sys.argv)) > > and run "test_args 1 2 abcd" > > none of "1 2 abcd" get printed - only sys.argv from the initial invocation > of Leo. > > is there a way for something like this to work? Apologies if it is already > documented, I cannot find it. > > Thanks > Jon N > > -- 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 visit https://groups.google.com/d/msgid/leo-editor/25d624a0-590d-4795-83c1-4b2ede75ccddn%40googlegroups.com.
