On Tue, Apr 30, 2013 at 5:35 PM, Edward K. Ream <edream...@gmail.com> wrote:
> On Sat, Nov 17, 2012 at 12:53 AM, Matt Wilkie <map...@gmail.com> wrote:
>>
>>
>> I'm working on a python command line script and am spening a lot of time
>> swtiching back and forth between a console window and Leo. Is there a way to
>> pass parameters to a node (script) executed with Ctrl-B, so I can do
>> everything from inside Leo?
>
>
> Good question.  There are lots of possibilities, and I think there are
> opportunities to improve Leo substantially.
>
> Are you executing the "command-line" script from Leo?  When I do that, I
> just specify the arguments as python strings or other variables.
>
> I'd like to add an *easy* way of executing arbitrary scripts in a separate
> process.  Yes, this can be done in each case using Python's subprocess
> module, but it's a bit futzy.

I often find myself wanting to run os stuff from Leo, when I do, subprocess
ends up consuming too much time. Since I've found 'sh'
https://pypi.python.org/pypi/sh/1.08

I haven't looked back, so far it has always just done what I want.

I know you are loathe to introduce dependencies, but maybe the
source of  sh would be helpful.

>
> A more ambitious approach is to write a state handler for your command that
> prompts the user for args.  This is the way Leo's find/change commands work,
> but it's way too much work for most scripts.
>
> I'm not sure I understand exactly what you are asking, but it's a question
> near to my heart.  Let's continue this discussion.
>
> 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 http://groups.google.com/group/leo-editor?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
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 http://groups.google.com/group/leo-editor?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to