process node, output to node and a quick settings question

24 views
Skip to first unread message

Lang Hurst

unread,
May 22, 2017, 7:33:22 PM5/22/17
to leo-editor
Quick settings question first: Where is the setting to make leo open with the last opened file? I am sure that I've looked at it in my searches, but I can't seem to find it.  The bigger issue is this:

 I currently have two noes that I'll say look like this:

node_A:                 node_B:

Banana                   Yellow,tropical fruit
                         cylindrical
Apple                    Red
                         round
, can be used as weapon against younger brother
kumkquat                
no idea

I can write them to a file and run:

with open('/home/lang/dir/D1A') as f1, open('/home/lang/dir/D1R') as f2:


  for x, y in zip(f1, f2):


     g.es("| {0}\t|\t{1} |".format(x.strip(), y.strip()))


From another node and it prints out what I'm looking for.


| Banana | Yellow, tropical fruit |
 
| | cylindrical |
| Apple | Red |
 
| | round, can be used as weapon against younger brother |
| kumkquat | no idea |



Then I copy and paste that log output to another node that I am using for my @rst document.  Is there an easier way to do this without writing out files and copy pasting?

Chris George

unread,
May 22, 2017, 7:51:53 PM5/22/17
to leo-e...@googlegroups.com
For starting with the exact same files/window settings as last session, you need to use the following command line options.

launchLeo.py --session-restore --session-save

Chris

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to leo-e...@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Lang Hurst

unread,
May 22, 2017, 7:55:16 PM5/22/17
to leo-e...@googlegroups.com
Thanks Chris. That works perfectly. I don't know if I would have found it. I kept searching for "open" "file" and the like. I appreciate it!

--
You received this message because you are subscribed to a topic in the Google Groups "leo-editor" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/leo-editor/y69Cy9_QDGs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to leo-editor+unsubscribe@googlegroups.com.

To post to this group, send email to leo-e...@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.



--
I have a foreboding of an America in my children's or grandchildren's time -- when the United States is a service and information economy; when nearly all the manufacturing industries have slipped away to other countries; when awesome technological powers are in the hands of a very few, and no one representing the public interest can even grasp the issues; when the people have lost the ability to set their own agendas or knowledgeably question those in authority; when, clutching our crystals and nervously consulting our horoscopes, our critical faculties in decline, unable to distinguish between what feels good and what's true, we slide, almost without noticing, back into superstition and darkness... - Carl Sagan

Terry Brown

unread,
May 22, 2017, 9:48:08 PM5/22/17
to leo-e...@googlegroups.com
On Mon, 22 May 2017 16:33:22 -0700 (PDT)
Lang Hurst <gra...@gmail.com> wrote:

> Quick settings question first: Where is the setting to make leo open
> with the last opened file? I am sure that I've looked at it in my
> searches, but I can't seem to find it. The bigger issue is this:
>
> I currently have two noes that I'll say look like this:
>
> node_A: node_B:
>
> Banana Yellow,tropical fruit
> cylindrical
> Apple Red
> round, can be used as weapon against younger
> brother
> kumkquat no idea
>
> I can write them to a file and run:
>
> with open('/home/lang/dir/D1A') as f1, open('/home/lang/dir/D1R') as
> f2:
>
> for x, y in zip(f1, f2):
>
> g.es("| {0}\t|\t{1} |".format(x.strip(), y.strip()))

a question of how you want to find the nodes, once you've found them,
their body text is just <some_var>.b. Perhaps the easiest:

n_1 = g.findNodeAnywhere(c, "node_A")
n_2 = g.findNodeAnywhere(c, "node_B")

answer = []
for x, y in zip(n_1.b.split('\n'), n_2.b.split('\n')):
answer.append("| {0}\t|\t{1} |".format(x.strip(), y.strip()))
n_3 = n_2.insertAfter()
n_3.b = '\n'.join(answer)
n_3.h = 'answer'
c.selectPosition(n_3)
c.redraw()

This assumes you call the two input nodes a specific thing, there are
other ways of addressing them.

Cheers -Terry

Lang Hurst

unread,
May 23, 2017, 12:39:44 PM5/23/17
to leo-e...@googlegroups.com
Terry,

Thank you very much. That works great and made my life so much
easier. I really appreciate it.

-Lang
> --
> You received this message because you are subscribed to a topic in the Google Groups "leo-editor" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/leo-editor/y69Cy9_QDGs/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to leo-editor+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages