On Wed, Nov 20, 2013 at 12:30 PM, Matt Wilkie <[email protected]> wrote:

> Also if you need to use a virgin environment or different python version
> or you'll need to create a @button to fire that up (hmmm, really should
> document that...)


When I said this I was thinking of a scipt I wrote a while back to open an
elevated command prompt on the current node, but there are some problems
with that approach. I've since realized that a cleaner and more direct
approach is to simply add an "open with" item to the file menu.
exit

Create a node called @setttings, and inside another one "@openwith python3
= Ctrl-Alt-Shift-P" as headline, with contents similar to the below. Exit
and reopen that .leo file. Now pressing [Ctrl-alt-shift-P] will fire the
currently selected node to the specified python interpreter.

ext:    .py
kind:   subprocess.Popen
arg:    "c:/python32/python.exe"


```
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by Leo (http://leoeditor.com/leo_toc.html) -->
<?xml-stylesheet ekr_test?>
<leo_file xmlns:leo="http://www.leo-editor.org/2011/leo"; >
<leo_header file_format="2"/>
<vnodes>
<v t="maphew.20131120121320.15853" a="E"><vh>@settings</vh>
<v t="maphew.20131120121320.15665"><vh>@openwith python3 =
Ctrl-Alt-Shift-P</vh></v>
</v>
</vnodes>
<tnodes>
<t tx="maphew.20131120121320.15665">#
'subprocess.Popen',['python','C:/Python32/python.exe',.py']

ext:    .py
kind:   subprocess.Popen
arg:    "c:/python32/python.exe"</t>
<t tx="maphew.20131120121320.15853"></t>
</tnodes>
</leo_file>
```

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to