On Mon, 22 May 2017 16:33:22 -0700 (PDT)
Lang Hurst <grak...@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 

-- 
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.

Reply via email to